/** * Set a raw unmodified attribute. * * @param $key * @param $value * @return $this */ public function setRawAttribute($key, $value) { parent::setAttribute($key, $value); return $this; }
/** * Set the attribute. * * @param string $key * @param mixed $value */ public function setAttribute($key, $value) { if (!($parent = $this->getParent())) { return null; } /* @var AssignmentInterface $assignment */ $assignment = $parent->getAssignment($key); if (!$assignment) { parent::setAttribute($key, $value); return; } $type = $assignment->getFieldType($this); $type->setEntry($this); $type->setLocale($this->locale); $accessor = $type->getAccessor(); $modifier = $type->getModifier(); $accessor->set($modifier->modify($value)); }