Esempio n. 1
0
 /**
  * @param \Terms $term
  * @param $error
  */
 protected function _saveProperty(\Terms &$term, &$error)
 {
     $properties = $this->request()->post('term_prop', 'ARRAY', array());
     foreach ($properties as $key => $value) {
         $obj = \TermProperty::getPropertyObj($term->getId(), $key);
         if (!$obj) {
             $obj = new \TermProperty();
             $obj->setTermId($term->getId());
             $obj->setPropertyKey($key);
         }
         $obj->setPropertyValue($value);
         $obj->save();
     }
 }
Esempio n. 2
0
 protected function _afterDelete()
 {
     TermProperty::write()->delete(TermProperty::getTableName())->where('term_id = ' . $this->getId())->execute();
     parent::_afterDelete();
 }