示例#1
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\UserLog
  */
 protected function makeBean($resultset)
 {
     return UserLogFactory::createFromArray($resultset);
 }
示例#2
0
 /**
  *
  * @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;
 }
示例#3
0
 /**
  * 
  * @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);
     }
 }