Пример #1
0
 /**
  * @param string    $userId
  * @param string    $authBackend
  * @param \DateTime $lastLogin
  *
  * @return \Cms\Data\UserStatus
  * @throws CmsException
  */
 public function setLastLogin($userId, $authBackend, \DateTime $lastLogin)
 {
     $orm = $this->getOrmByUserIdAndAuthBackend($userId, $authBackend, false);
     if (is_null($orm)) {
         $orm = new OrmUserStatus();
         $orm->setUserId($userId);
         $orm->setAuthbackend($authBackend);
     }
     try {
         $orm->setLastlogin($lastLogin);
         $entityManager = $this->getEntityManager();
         $entityManager->persist($orm);
         $entityManager->flush();
         $entityManager->refresh($orm);
         $this->clearEntityManager();
     } catch (\Exception $e) {
         throw new CmsException(2811, __METHOD__, __LINE__, null, $e);
     }
     return $orm->toCmsData();
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function setAuthbackend($authbackend)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setAuthbackend', array($authbackend));
     return parent::setAuthbackend($authbackend);
 }