protected function _mapModelToMongoModel(array $model)
 {
     unset($model['resId']);
     return parent::_mapModelToMongoModel($model);
 }
 public function getDefaultTags()
 {
     $tags = parent::getDefaultTags();
     $tags[] = \App::getUserLogged()->id;
     return $tags;
 }
示例#3
0
 /**
  *
  * @param  type                     $userId
  * @return type
  * @throws InvalidArgumentException
  * @throws MongoException
  */
 public function getLastUsedPasswords($userId)
 {
     if (!$userId) {
         throw new InvalidArgumentException(get_class($this) . ": userId param not given <<");
     }
     try {
         $collection = new \MongoCollection(\App::getMongoDB(), 'user_password');
         $result = $collection->findOne(array('_id' => $userId));
         $result = $result ? parent::_mapMongoModelToModel($result) : array();
     } catch (\Exception $e) {
         throw new MongoException($e->getMessage());
     }
     return isset($result['passwords']) ? $result['passwords'] : array();
 }