本文整理汇总了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);
}