Esempio n. 1
0
 /**
  * @param integer $id
  * @return Category
  */
 public static function findById($id)
 {
     return Category::findById($id);
 }
Esempio n. 2
0
 /**
  * @param integer $categoryId - category id
  * @return array - an array having value as key and name as value for given category id.
  */
 public static function getValueNameMapByCategoryId($categoryId)
 {
     $category = Category::findById($categoryId);
     $options = $category->options;
     $optionsMap = array();
     foreach ($options as $option) {
         $optionsMap[$option->value] = $option->name;
     }
     return $optionsMap;
 }