public function __construct($name) { parent::__construct($name); $this->attributes['type'] = 'file'; }
public function updateEntity(AbstractElement $element) { $property = $element->getPropertyName(); $value = $element->getValue(); $setter = 'set' . ucfirst($property); if (is_callable([$this->entity, $setter])) { $this->entity->{$setter}($value); } else { $reflectionObject = new \ReflectionObject($this->entity); if ($reflectionObject->hasProperty($property) && $reflectionObject->getProperty($property)->isPublic()) { $this->entity->{$property} = $value; } } }