array( 'data_type' => 'integer', 'primary' => true, 'autocomplete' => true, ), 'USER_ID' => array( 'data_type' => 'integer' ), 'PRIORITY' => array( 'data_type' => 'integer' ), 'ACTION' => array( 'data_type' => 'string' ), 'ACTION_DATE' => array( 'data_type' => 'datetime' ), 'APPLICATION_ID' => array( 'data_type' => 'string' ), ); } /** * @param int $userId * @param string|null $applicationId AppPassword application id * @return ORM\Data\AddResult * @throws ObjectException */ public static function addLogoutAction($userId, $applicationId = null) { return static::add(array( 'USER_ID' => $userId, 'PRIORITY' => self::PRIORITY_HIGH, 'ACTION' => self::ACTION_LOGOUT, 'ACTION_DATE' => new Type\DateTime(), 'APPLICATION_ID' => $applicationId, )); } /** * @param int $userId * @param Type\DateTime|null $date * @return ORM\Data\AddResult */ public static function addUpdateAction($userId, Type\DateTime $date = null) { if($date === null) { $date = new Type\DateTime(); } return static::add(array( 'USER_ID' => $userId, 'PRIORITY' => self::PRIORITY_LOW, 'ACTION' => self::ACTION_UPDATE, 'ACTION_DATE' => $date, )); } }