/** * * makeBean * @param array $resultset * @return \Application\Model\Bean\UserLog */ protected function makeBean($resultset) { return UserLogFactory::createFromArray($resultset); }
/** * * @param User $user * @param int $eventType * @return \Application\Model\Bean\UserLog */ protected function newLog(User $user, $eventType, $note = '') { $date = new Zend_Date(); $log = \Application\Model\Factory\UserLogFactory::createFromArray(array('id_user' => $user->getIdUser(), 'event_type' => $eventType, 'ip' => $this->getRequest()->getServer("REMOTE_ADDR"), 'id_responsible' => $this->getUser()->getBean()->getIdUser(), 'timestamp' => $date->get('yyyy-MM-dd HH:mm:ss'), 'note' => $note)); $this->getCatalog('UserLogCatalog')->create($log); return $log; }
/** * * @param User $user * @param int $userLogType */ public function logOut($user, $userLogType) { if ($user) { $userLog = UserLogFactory::createFromArray(array('id_user' => $user->getIdUser(), 'event_type' => $userLogType, 'ip' => $this->getRequest()->getServer("REMOTE_ADDR"), 'id_responsible' => $user->getIdUser(), 'timestamp' => null, 'note' => 'Cierre de sesi�n')); $this->userLogCatalog->create($userLog); } }