function del(Criteria $c) { $condition = $c->getCondition("categoryId"); $categoryId = $condition['value']; $childCategoriesIds = array_map(create_function('$category', 'return $category[\'categoryId\'];'), $this->getChilds($categoryId, true)); $parentIds = array_map(create_function('$category', 'return $category[\'categoryId\'];'), $this->getParents($categoryId)); //creating list of items to delete $c = new Criteria(); $c->add("categoryId", $childCategoriesIds, "IN"); $itemIds = $this->site->getArray($c, "siteId", false); //delete all categories and subcategoeis $c = new Criteria(); $c->add("categoryId", $childCategoriesIds, "IN"); parent::del($c); $this->extraFieldCategory->del($c); $c = new Criteria(); $c->add("childId", $childCategoriesIds, "IN"); $c->addOr("parentId", $childCategoriesIds, "IN"); $this->categoryParent->del($c); //deleting items foreach ($itemIds as $itemId) { $c = new Criteria(); $c->add("siteId", $itemId); $this->site->del($c, false); } $this->updateValidatedSitesCount($parentIds); Cacher::getInstance()->clean("tag", array("category", "site")); }
function del(Criteria $c) { $condition = $c->getCondition("adCriterionId"); $nc = new Criteria(); $nc->addCondition($condition); parent::del($c); Model::factoryInstance("ad")->del($nc); }
function del(Criteria $c, $updateStats = true) { if ($updateStats) { $siteIds = array_unique($this->getArray($c, "siteId")); } parent::del($c); if ($updateStats) { foreach ($siteIds as $siteId) { $this->updateSiteCommentsCount($siteId); } } }
public function del($data) { /** Retrieve aliases */ $alias = Model::load('alias'); /** Retrieve attachments */ $attachment = Model::load('attachment'); /** Retrieve comments */ $comment = Model::load('comment'); /** Retrieve groups */ $grouped_content = Model::load('grouped_content'); /** Retrieve tags */ $tagged_content = Model::load('tagged_content'); return parent::del($data); }
function del(Criteria $c) { parent::del($c); Cacher::getInstance()->clean("tag", array("user")); }
function del(Criteria $c, $updateStats = true) { $condition = $c->getCondition("siteId"); $nc = new Criteria(); $nc->addCondition($condition); parent::del($c); Model::factoryInstance("keywordsOfSite")->del($nc); Model::factoryInstance("comment")->del($nc, false); Model::factoryInstance("hit")->del($nc); $nc = new Criteria(); $condition['key'] = "itemId"; $nc->addCondition($condition); Model::factoryInstance("extraFieldValue")->del($nc); $photos = Model::factoryInstance("photo")->findAll($nc, "*", true); foreach ($photos as $photo) { $photo->del(false); } if ($updateStats) { $this->updateStats(); } }
function del(Criteria $c) { parent::del($c); $this->site->updateStats(); }
/** * 删除图片,根据图片ID * @param int $image_id */ static function delPicByImageId($image_id) { $db_name = PREFIX . 'images i'; $m = new Model(); $data = $m->getOne($db_name, "i.id={$image_id}", "i.path as p, i.big_img as b, i.small_img as s"); foreach ($data as $v) { @self::delFile(ROOT_PATH . $v['p']); @self::delFile(ROOT_PATH . $v['b']); @self::delFile(ROOT_PATH . $v['s']); } $m->del(PREFIX . 'images', "id={$image_id}"); unset($m); }
function delete($id = null, $cascade = true) { return parent::del($id, $cascade); }