public static function getCategory($catId) { $catModel = new categoryModel(self::$doctrineService); $catInfo = $catModel->findOneBy(array('id' => $catId)); if ($catInfo) { return $catInfo; } return new Categories(); }
public static function getCategoryForSelect() { $doctrineService = self::$servicelocator->get('doctrine'); $categoryModel = new categoryModel($doctrineService); $cat = $categoryModel->findBy(array('isdelete' => 0)); $return = array(); foreach ($cat as $item) { $return[$item->getId()] = $item->getName(); } return $return; }