public function buildAttribute(BuildAttributeEvent $event)
    {
        $attribute = $event->getAttribute();
        if (!($attribute instanceof File) || !$attribute->get('file_multiple')) {
            return;
        }

        $container  = $event->getContainer();
        $properties = $container->getPropertiesDefinition();
        $name       = $attribute->getColName();
        $nameSort   = \sprintf('%s__sort', $name);

        if ($properties->hasProperty($nameSort)) {
            $this->addAttributeToDefinition($container, $name);
            $properties->getProperty($name . '__sort')->setWidgetType('fileTreeOrder');

            return;
        }

        $properties->addProperty($property = new DefaultProperty($name . '__sort'));
        $property->setWidgetType('fileTreeOrder');

        $this->addAttributeToDefinition($container, $name);
    }
public function buildAttribute(BuildAttributeEvent $event)
    {
        $attribute = $event->getAttribute();
        if (!($attribute instanceof File) || !$attribute->get('file_multiple')) {
            return;
        }

        $container  = $event->getContainer();
        $properties = $container->getPropertiesDefinition();
        $name       = $attribute->getColName();
        $nameSort   = \sprintf('%s__sort', $name);

        if ($properties->hasProperty($nameSort)) {
            $this->addAttributeToDefinition($container, $name);
            $properties->getProperty($name . '__sort')->setWidgetType('fileTreeOrder');

            return;
        }

        $properties->addProperty($property = new DefaultProperty($name . '__sort'));
        $property->setWidgetType('fileTreeOrder');

        $this->addAttributeToDefinition($container, $name);
    }
public function buildAttribute ( BuildAttributeEvent $ event ) { $ attribute = $ event -> getAttribute ( ) ; if ( ! ( $ attribute instanceof File ) || ! $ attribute -> get ( 'file_multiple' ) ) { return ; } $ container = $ event -> getContainer ( ) ; $ properties = $ container -> getPropertiesDefinition ( ) ; $ name = $ attribute -> getColName ( ) ; $ nameSort = \ sprintf ( '%s__sort' , $ name ) ; if ( $ properties -> hasProperty ( $ nameSort ) ) { $ this -> addAttributeToDefinition ( $ container , $ name ) ; $ properties -> getProperty ( $ name . '__sort' ) -> setWidgetType ( 'fileTreeOrder' ) ; return ; } $ properties -> addProperty ( $ property = new DefaultProperty ( $ name . '__sort' ) ) ; $ property -> setWidgetType ( 'fileTreeOrder' ) ; $ this -> addAttributeToDefinition ( $ container , $ name ) ; }
This builds the dc-general property information for the virtual file order attribute.

@param BuildAttributeEvent $event The event being processed.

@return void
This builds the dc - general property information for the virtual file order attribute .