Ejemplo n.º 1
0
 /**
  * @return string
  */
 public function getHierarchicalName()
 {
     if ($this->parent === null) {
         return $this->name;
     }
     return $this->parent->getHierarchicalName() . '.' . $this->name;
 }
Ejemplo n.º 2
0
 /**
  * @param Config\AbstractPropertyConfig $property
  * @return array
  */
 private function getPropertyData(Config\AbstractPropertyConfig $property)
 {
     if ($property instanceof Config\PropertySetConfig) {
         $setData = array();
         foreach ($property as $subProperty) {
             $setData[] = $this->getPropertyData($subProperty);
         }
         return array('id' => $property->name, 'type' => 'Set', 'label' => $property->getLabel(), 'properties' => $setData);
     } elseif ($property instanceof Config\PropertyListConfig) {
         return array('id' => $property->name, 'type' => 'Collection', 'label' => $property->getLabel(), 'properties' => $this->getPropertyData($property->getListItem()));
     } elseif ($property instanceof Config\PropertyConfig) {
         $editable = $property->getEditable();
         return array('id' => $property->name, 'value' => $editable->getDefaultValue(), 'type' => $editable->getEditorType(), 'label' => $editable->getLabel(), 'description' => $editable->getDescription()) + $editable->getAdditionalParameters();
     } else {
         throw new \UnexpectedValueException(sprintf('Don\'t know what do to with [%s].', get_class($property)));
     }
 }
Ejemplo n.º 3
0
 /**
  * @param AbstractPropertyConfig $item
  */
 public function setListItem(AbstractPropertyConfig $item)
 {
     $item->setParent($this);
     $this->item = $item;
 }
Ejemplo n.º 4
0
 /**
  * @param AbstractPropertyConfig $item
  */
 public function addSetItem(AbstractPropertyConfig $item)
 {
     $item->setParent($this);
     $this->items[$item->name] = $item;
 }
Ejemplo n.º 5
0
 /**
  * @param string $name
  * @param Editable $editable
  */
 public function __construct($name, Editable $editable)
 {
     parent::__construct($name);
     $this->editable = $editable;
 }