/** * @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(); }
/** * {@inheritDoc} */ public function toCmsData() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'toCmsData', array()); return parent::toCmsData(); }