/**
  * @param string|null $name
  * @param string|null $type
  * @param string|null $label
  * @param string|null $propertyPath
  * @return Attribute
  */
 protected function createAttribute($name = null, $type = null, $label = null, $propertyPath = null)
 {
     $result = new Attribute();
     $result->setName($name);
     $result->setType($type);
     $result->setLabel($label);
     $result->setPropertyPath($propertyPath);
     return $result;
 }
Exemplo n.º 2
0
 /**
  * @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;
 }
Exemplo n.º 3
0
 /**
  * @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;
 }