Esempio n. 1
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->attributes['type'] = 'file';
 }
Esempio n. 2
0
 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;
         }
     }
 }