Esempio n. 1
0
 /**
  * @param Mongostar_Model_Mapper_Interface $mapper
  *
  * @throws Exception
  */
 public static function setMapper(Mongostar_Model_Mapper_Interface $mapper)
 {
     $decorators = $mapper->getDecorators();
     $mapper->setDecorators($decorators);
     if (!empty($decorators)) {
         foreach ($decorators as $decorator) {
             if (class_exists($decorator)) {
                 $mapper = new $decorator($mapper);
             } else {
                 throw new Exception("Mapper decorator {$decorator} not found");
             }
         }
     }
     self::$_mappers[self::_getClassName()] = $mapper;
 }
Esempio n. 2
0
 /**
  * @return int
  */
 public function count()
 {
     return $this->_mapper->getCount($this->_cond, $this->_sort);
 }