Ejemplo n.º 1
0
 /**
  * Fetch a user by its id
  *
  * @param int $id
  *
  * @return Default_Model_User
  *
  * @todo implement caching
  */
 public function fetchById($id)
 {
     $cache = $this->getCache();
     if (!($user = $cache->load('user_id_' . $id))) {
         $user = $this->_mapper->fetchById($id);
         $cache->save($user, 'user_id_' . $id);
     }
     return $user;
 }