本文整理匯總了PHP中waModel::deleteByField方法的典型用法代碼示例。如果您正苦於以下問題:PHP waModel::deleteByField方法的具體用法?PHP waModel::deleteByField怎麽用?PHP waModel::deleteByField使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類waModel
的用法示例。
在下文中一共展示了waModel::deleteByField方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteByField
public function deleteByField($field, $value = null)
{
if (is_array($field)) {
$items = $this->getByField($field, $this->id);
} else {
$items = $this->getByField($field, $value, $this->id);
}
$res = false;
if ($ids = array_keys($items)) {
$res = parent::deleteByField($this->id, $ids);
if ($res) {
$type_upselling_model = new shopTypeUpsellingModel();
$type_upselling_model->deleteByField('feature_id', $ids);
$params_model = new shopProductFeaturesModel();
$params_model->deleteByField('feature_id', $ids);
$types = $this->groupByValueType($items);
foreach ($types as $type => $type_ids) {
if ($model = self::getValuesModel($type)) {
$model->deleteByField('feature_id', $type_ids);
}
}
$this->deleteByField('parent_id', $ids);
}
}
return $res;
}
示例2: deleteByField
public function deleteByField($field, $value = null)
{
$post_category_model = new blogCategoryPostModel();
if ($field == $this->id) {
$ids = $value;
} else {
$ids = $this->select($this->id)->where($this->getWhereByField($field, $value))->fetchAll();
}
$post_category_model->deleteByField('category_id', $ids);
parent::deleteByField($field, $value);
}