/** * Implements adder mechanism. * * @param Opus_Model_Field $field The field to work on. * @param mixed $arguments Arguments passed in the get-call. * * @return Opus_Model_Abstract The added model (can be a new model). */ protected function _addFieldValue(Opus_Model_Field $field, $value) { if (is_null($value)) { $modelclass = $field->getValueModelClass(); if (is_null($modelclass)) { throw new Opus_Model_Exception('Add accessor without parameter currently only available for fields holding models.'); } $value = new $modelclass(); } $field->addValue($value); return $value; }