示例#1
0
 /**
  * Convert the categories to categories ids
  * 
  * @param string $cats Categories full names
  * @return string Categogories indexes ids
  */
 public static function categoryNamesToIds($cats)
 {
     if ($cats === "") {
         $cats = array();
     } else {
         $cats = explode(",", $cats);
     }
     kArray::trim($cats);
     $catsIds = array();
     foreach ($cats as $cat) {
         $categories = categoryPeer::getByFullNameWildcardMatch($cat);
         foreach ($categories as $category) {
             $catsIds[] = $category->getId();
         }
     }
     return implode(",", $catsIds);
 }