/**
  * @param AdministratorEvent $event
  * @param $eventName
  * @param EventDispatcherInterface $dispatcher
  */
 public function update(AdministratorEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     if (null !== ($administrator = AdminQuery::create()->findPk($event->getId()))) {
         $administrator->setDispatcher($dispatcher)->setFirstname($event->getFirstname())->setLastname($event->getLastname())->setLogin($event->getLogin())->setEmail($event->getEmail())->setProfileId($event->getProfile())->setLocale($event->getLocale());
         if ('' !== $event->getPassword()) {
             $administrator->setPassword($event->getPassword());
         }
         $administrator->save();
         $event->setAdministrator($administrator);
     }
 }