Exemplo n.º 1
0
 /**
  * 
  * @param type $user_id
  * @param type $index
  * @return MapasCulturais\Entities\User
  */
 public function getUser($user_id = null, $index = 0)
 {
     if ($user_id instanceof \MapasCulturais\Entities\User) {
         return $user_id;
     } else {
         if (key_exists($user_id, $this->app->config['userIds'])) {
             return $this->app->repo('User')->find($this->app->config['userIds'][$user_id][$index]);
         } else {
             return $this->app->repo('User')->find($user_id);
         }
     }
 }