Update event.

@param IEvent $event

@return bool
335527
protected function update(IEvent $event)
    {
        $statement = $this->connection->prepare(
            'UPDATE ' . $this->table . ' SET response = :response, SET latency = :latency WHERE id = :id'
        );

        $statement->execute(
            [
                ':id' => $event->getId(),
                ':response' => $event->getResponse(),
                ':latency' => $event->getLatency(),
            ]
        );

        return $statement->columnCount() === 1;
    }
291870
protected function trigger($event)
    {
        $class = static::class;

        if ($this->withEvent && isset(self::$event[$class][$event])) {
            foreach (self::$event[$class][$event] as $callback) {
                $result = call_user_func_array($callback, [$this]);

                if (false === $result) {
                    return false;
                }
            }
        }

        return true;
    }
1036021
public function updateCollection(EntityChangeEventInterface $event)
    {
        $collection = $event->getCollection();
        if ($collection->getId()) {
            $collectionMap = $this->getCollectionsMap();
            $collectionMap
                ->set($collection->getId(), $collection);
        }
    }
256713
public function addEvent(Event $event)
    {
        $this->clear();
        $this->events[$event->getName()] = $event;

        return $this;
    }
632171
public static function updateLastVisit($event)
    {
        if ($event->isValid) {
            /**
             * @var User $user
             */
            $user = $event->identity;
            $user->last_visit_at = time();
            $user->updateAttributes(['last_visit_at']);
            return true;
        }
        return false;
    }
1252659
public static function postUpdate( \Composer\Script\Event $event )
    {
        $_composer = $event->getComposer();
        $_package = $_composer->getPackage();
        // do stuff
    }
119168
public function runHandler(Event $event)
    {
        if (is_callable($this->handler)) {
            return call_user_func($this->handler, $event);
        }
        return false;
    }
185054
public function end(IEvent $event, $response)
    {
        $endTimestamp = microtime(true);

        $event->setResponse($response);
        $event->setLatency($endTimestamp - $this->startTimestamp);

        return $this->adapter->save($event);
    }
33612
public function updateIndexedContent(ContentEvent $event)
    {
        $content = $event->getContent();
        if (true === $content->getStatus()->isPublishedState()
        ) {
            $this->contentIndexor->index($content);
        } elseif (null !== $event->getPreviousStatus() && true === $event->getPreviousStatus()->isPublishedState()) {
            $this->contentIndexor->delete($content);
        }
    }
999636
public static function updateCito(Event $event)
    {
        $options = static::getOptions($event);
        $configDir = $options['symfony-config-dir'];
        $templateDir = $options['symfony-template-dir'];
        $fs = new Filesystem();

        /*
         * Update config/packages/cito.yaml
         */
        $yaml = Yaml::parseFile($configDir . '/packages/cito.yaml');
        if (!array_key_exists('user_agent_enabled', $yaml['cito'])) {
            $yaml['cito']['user_agent_enabled'] = false;
        }
        if (!array_key_exists('default_user_agent', $yaml['cito'])) {
            $yaml['cito']['default_user_agent'] = 'new';
        }
        if (!array_key_exists('user_agent_routing', $yaml['cito'])) {
            $yaml['cito']['user_agent_routing'] = [
                'new' => 'ie 11, opera > 52',
                'old' => 'ie < 11, opera < 52'
            ];
        }
        if (!array_key_exists('translation_enabled', $yaml['cito'])) {
            $yaml['cito']['translation_enabled'] = false;
        }
        if (!array_key_exists('translation_support', $yaml['cito'])) {
            $yaml['cito']['translation_support'] = [
                'de' => 'Deutsch',
                'en' => 'Englisch'
            ];
        }

        $fs->remove($configDir . '/packages/cito.yaml');
        $fs->dumpFile($configDir . '/packages/cito.yaml', Yaml::dump($yaml, 99));
    }
1305733
private function addEvent($event)
    {
        if (is_string($event)) {
            $event = Event::named($event);
        }

        if (!$event instanceof EventInterface) {
            throw new \InvalidArgumentException(
                'Events should be provides as Event instances or string, received type: ' . gettype($event)
            );
        }

        $this->events[] = $event;

        return $event;
    }
701460
public function addEventToList(Event $event)
    {
        if ($this->_eventList) {
            $this->_eventList->add($event);
        }

        return $this;
    }
963310
public function setEvent(\Claroline\AgendaBundle\Entity\Event $event)
    {
        $this->event = $event;

        return $this;
    }
142238
protected function invokeSubscriberByInstance($subscriber, IEvent $event) {
        if (is_object($subscriber) && method_exists($subscriber, 'handle')) {
            $this->invokeSubscriber($subscriber, $event);

            return true;
        }

        return false;
    }
308005
public static function onUpdate(Event $event)
    {
        $content = $event->getTarget();
        if (!($content instanceof AbstractClassContent)) {
            throw new BBException(
                'Enable to update object',
                BBException::INVALID_ARGUMENT,
                new \InvalidArgumentException(sprintf(
                    'Only BackBee\ClassContent\AbstractClassContent can be commit, `%s` received',
                    get_class($content)
                ))
            );
        }

        $dispatcher = $event->getDispatcher();
        if (null === $application = $dispatcher->getApplication()) {
            throw new BBException(
                'Enable to update object',
                BBException::MISSING_APPLICATION,
                new \RuntimeException('BackBee application has to be initialized')
            );
        }

        if (null === $token = $application->getBBUserToken()) {
            throw new SecurityException('Enable to update : unauthorized user', SecurityException::UNAUTHORIZED_USER);
        }

        $em = $dispatcher->getApplication()->getEntityManager();
        if (null === $revision = $content->getDraft()) {
            if (null === $revision = $em->getRepository('BackBee\ClassContent\Revision')->getDraft($content, $token)) {
                throw new ClassContentException('Enable to get draft', ClassContentException::REVISION_MISSING);
            }
            $content->setDraft($revision);
        }

        $content->releaseDraft();
        if (0 == $revision->getRevision() || $revision->getRevision() == $content->getRevision) {
            throw new ClassContentException('Content is up to date', ClassContentException::REVISION_UPTODATE);
        }

        $lastCommitted = $em->getRepository('BackBee\ClassContent\Revision')->findBy([
            '_content'  => $content,
            '_revision' => $content->getRevision(),
            '_state'    => Revision::STATE_COMMITTED,
        ]);
        if (null === $lastCommitted) {
            throw new ClassContentException(
                'Enable to get last committed revision',
                ClassContentException::REVISION_MISSING
            );
        }

        $content->updateDraft($lastCommitted);
    }
634022
public function handle( IEvent $event, $name, IDispatcher $dispatcher )
    {
        $sections = explode( '\\', get_class( $event ) );
        $class    = $sections[ count( $sections ) - 1 ];

        $name = strtolower( substr( $class, 0, 1 ) ) . substr( $class, 1 ) . 'Handler';

        $this->{$name}( $event );
    }
531968
public function beforeUpdate($event)
    {
        $fields = $this->fields;
        $nowDate = gmdate($this->databaseTimeFormat);
        if (!$this->isActuallyDirty()) {
            return;
        }

        if (isset($this->fields['modifiedField']) && !$this->owner->isAttributeChanged($this->fields['modifiedField'])) {
            $this->owner->{$this->fields['modifiedField']} = $nowDate;
        }
        if (isset($this->fields['modifiedByField']) && !$this->owner->isAttributeChanged($this->fields['modifiedByField'])) {
            $this->owner->{$this->fields['modifiedByField']} = self::_getUserId();
        }
    }