/** * @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(); } }
/** * @param $property * @return null|\TermProperty */ public function getProperty($property) { return \TermProperty::getPropertyObj($this->id, $property); }