Пример #1
0
 /**
  * @param string $name
  * @return Category
  */
 public static function findByName($name)
 {
     return Category::findByName($name);
 }
Пример #2
0
 /**
  * @param integer $categoryName - category name
  * @return array - an array having value as key and name as value for given category name.
  */
 public static function getValueNameMapByCategoryName($categoryName)
 {
     $category = Category::findByName($categoryName);
     $options = $category->options;
     $optionsMap = array();
     foreach ($options as $option) {
         $optionsMap[$option->value] = $option->name;
     }
     return $optionsMap;
 }