Пример #1
0
 /**
  * Looks for and deletes the sub-ShopCategory named $name
  * contained by the ShopCategory specified by $parent_id.
  *
  * The child's name must be unambiguous, or the method will fail.
  * @param   integer   $category_id  The parent ShopCategory ID
  * @param   string    $name         The ShopCategory name to delete
  * @return  boolean                 True on success, false otherwise
  * @author  Reto Kohli <*****@*****.**>
  * @static
  */
 static function deleteChildNamed($parent_id, $name)
 {
     $objCategory = new ShopCategory($name, $parent_id, '', '', '');
     $arrChild = $objCategory->getByWildcard();
     if (is_array($arrChild) && count($arrChild) == 1) {
         return $arrChild[0]->delete();
     }
     return false;
 }