/** * @param string|null $name * @param string|null $type * @param string|null $label * @return Attribute */ protected function createAttribute($name = null, $type = null, $label = null) { $result = new Attribute(); $result->setName($name); $result->setType($type); $result->setLabel($label); return $result; }
/** * @param string $name * @param string $label * @param string $type * @param array $options * @return Attribute */ protected function getAttribute($name, $label, $type, array $options = array()) { $attribute = new Attribute(); $attribute->setName($name); $attribute->setLabel($label); $attribute->setType($type); $attribute->setOptions($options); return $attribute; }
/** * @param string $name * @param array $options * @return Attribute */ protected function assembleAttribute($name, array $options) { $options = $this->addDefaultOptions($options); $this->assertOptions($options, array('label', 'type')); $attribute = new Attribute(); $attribute->setName($name); $attribute->setLabel($options['label']); $attribute->setType($options['type']); $attribute->setOptions($this->getOption($options, 'options', array())); $this->validateAttribute($attribute); return $attribute; }
/** * @param WorkflowDefinition $definition * @param string $name * @param array $options * @return Attribute */ protected function assembleAttribute(WorkflowDefinition $definition, $name, array $options) { if (!empty($options['property_path'])) { $options = $this->guessOptions($options, $definition->getRelatedEntity(), $options['property_path']); } $this->assertOptions($options, array('label', 'type')); $this->assertAttributeEntityAcl($options); $attribute = new Attribute(); $attribute->setName($name); $attribute->setLabel($options['label']); $attribute->setType($options['type']); $attribute->setEntityAcl($this->getOption($options, 'entity_acl', array())); $attribute->setPropertyPath($this->getOption($options, 'property_path')); $attribute->setOptions($this->getOption($options, 'options', array())); $this->validateAttribute($attribute); return $attribute; }
/** * @param string $name * @param string $label * @param string $type * @param array $options * @param string $propertyPath * @param array $entityAcl * @return Attribute */ protected function getAttribute($name, $label, $type, array $options = array(), $propertyPath = null, array $entityAcl = array()) { $attribute = new Attribute(); $attribute->setName($name); $attribute->setLabel($label); $attribute->setType($type); $attribute->setOptions($options); $attribute->setPropertyPath($propertyPath); $attribute->setEntityAcl($entityAcl); return $attribute; }