/** * Set a property or fields. * * @param string $property * @param mixed $value */ public function __set($property, $value) { if (property_exists($this->instance, $property)) { if (array_key_exists($property, $this->fields)) { notice('Property "' . $property . '" is ambiguous. It\'s available in both the instance as the junction fields.', "To modify the mapping of the junction field change the value of \$ModelConfig->hasMany[\$relation]['fields']['" . $property . "']"); } $this->instance->{$property} = $value; return; } if (array_key_exists($property, $this->fields) || $this->dynamicFields) { $this->fields[$property] = $value; return; } parent::__set($property, $value); }
public function __set($property, $value) { if ($this->_state == 'deleted') { notice('A deleted Record has no properties'); } else { return parent::__set($property, $value); } }