public function lastInsertID()
    {
        if (isset($this->persistence) && $this->persistence instanceof Persistence\SQL) {
            return $this->persistence->connection->lastInsertId($this);
        }

        throw new Exception('Model is not associated with SQL-enabled persistence');
    }