/** * Fungsi untuk mendapatkan kategori dalam bentuk hierarki * @return type */ public function getAllHierarchyByLanguage() { // Model $categoryDb = new Model_DbTable_Category(); // query category $categoryParent = $categoryDb->getAllParentCategoryIdNameByLangId($this->_languageId); $categoryChildren = $categoryDb->getAllButNotMainCategoryWithCounter($this->_languageId); // should be converted to array $categoryParent = $categoryParent->toArray(); $categoryChildren = $categoryChildren->toArray(); $hierarchyCategory = $this->buildCategoryHierarchy($categoryParent, $categoryChildren); return $hierarchyCategory; }