setCategories(); } /** * * get categories table service * * @return \Ppb\Service\Table\Relational\Categories */ public function getCategories() { return $this->_categories; } /** * * set categories table service * * @param \Ppb\Service\Table\Relational\Categories $categories * @return $this */ public function setCategories(CategoriesService $categories = null) { if (!$categories instanceof CategoriesService) { $categories = new CategoriesService(); } $this->_categories = $categories; return $this; } public function getData() { return $this->_data; } /** * * get all categories having a certain parent id * * @param string|\Cube\Db\Select $where SQL where clause, or a select object * @return array */ public function categories($where = null) { if ($where === null) { return $this; } $this->_data = $this->getCategories()->fetchAll($where); return $this->_data; } }