/** * Get the collection class name for the collection of entities * @return string */ protected function _getCollectionClass() { if (null == $this->_collectionClass) { $this->setCollectionClass(App_Model::getClassSibling($this, App_Model::MODEL_TYPE_COLLECTION)); } return $this->_collectionClass; }
/** * Returns the dbTable object * @return App_Db_Table */ public function getDbTable() { if (null == $this->_dbTable) { if (!($class = $this->_dbTableClass)) { $class = App_Model::getClassSibling($this, App_Model::MODEL_TYPE_DBTABLE); } $this->_dbTable = new $class(); } return $this->_dbTable; }
/** * Returns an array of items for a page. * * @param integer $offset Page offset * @param integer $itemCountPerPage Number of items per page * @return array */ public function getItems($offset, $itemCountPerPage) { $result = parent::getItems($offset, $itemCountPerPage); $entityCollectionClass = App_Model::getClassSibling($this->_mapper, App_Model::MODEL_TYPE_COLLECTION); return new $entityCollectionClass($result); }