/** * @param string $code * @param AttributeTypeConfigurationHandler $attributeTypeConfigurationHandler * @param array $configuration * @throws UnexpectedValueException * @throws AccessException * @throws InvalidArgumentException * @throws UnexpectedTypeException */ public function __construct($code, AttributeTypeConfigurationHandler $attributeTypeConfigurationHandler, array $configuration = null) { $this->code = $code; $this->type = $attributeTypeConfigurationHandler->getType($configuration['type']); unset($configuration['type']); $accessor = PropertyAccess::createPropertyAccessor(); foreach ($configuration as $key => $value) { $accessor->setValue($this, $key, $value); } $this->type->setAttributeDefaults($this); // Allow attribute type service to configure attribute $this->checkConflicts(); }
/** * @inheritdoc */ public function __construct($code, $databaseType, $formType, array $formOptions = []) { parent::__construct($code, $databaseType, $formType, $formOptions); $this->isRelation = false; }