Exemplo n.º 1
0
 public function deleteByField($field, $value = null)
 {
     if (is_array($field)) {
         $items = $this->getByField($field, $this->id);
         $ids = array_keys($items);
     } else {
         if ($field == $this->id) {
             $ids = $value;
         } else {
             $items = $this->getByField($field, $value, $this->id);
             $ids = array_keys($items);
         }
     }
     $res = false;
     if ($ids) {
         if ($res = parent::deleteByField($this->id, $ids)) {
             $model = new shopPluginSettingsModel();
             $model->deleteByField('id', $ids);
         }
     }
     return $res;
 }
Exemplo n.º 2
0
 public function insert($data, $type = 0)
 {
     $id = parent::insert($data, $type);
     if ($id) {
         $model = new shopTypeFeaturesModel();
         $model->addType($id);
     }
     return $id;
 }