/** {@inheritDoc} */ public function beforeSet() { $fieldName = $this->getProperty('field_name', null); $fieldValue = $this->getProperty('field_value', null); $this->properties = $this->object->toArray(); if (!is_null($fieldName) and !is_null($fieldValue)) { $this->setProperty($fieldName, $fieldValue); } return parent::beforeSet(); }
/** {@inheritDoc} */ public function beforeSave() { $fieldName = $this->getProperty('field_name', null); $fieldValue = $this->getProperty('field_value', null); if (!is_null($fieldName) && !is_null($fieldValue)) { $array = $this->object->toArray(); if (isset($array[$fieldName])) { $this->object->fromArray(array($fieldName => $fieldValue)); } } return parent::beforeSave(); }