public function handleUpdateAttribute(PostPersistModelEvent $event)
    {
        $model = $event->getModel();

        if (('file' !== $model->getProperty('type'))
            || (!$model->getProperty('file_multiple'))
            || ('tl_metamodel_attribute' !== $event->getEnvironment()->getDataDefinition()->getName())
        ) {
            return;
        }

        $metaModelsName = $this->getFactory()->translateIdToMetaModelName($model->getProperty('pid'));
        $metaModel      = $this->getFactory()->getMetaModel($metaModelsName);
        $attributeName  = $model->getProperty('colname') . '__sort';
        $tableColumns   = $this->connection->getSchemaManager()->listTableColumns($metaModel->getTableName());

        if (\array_key_exists($attributeName, $tableColumns)) {
            return;
        }

        $this->tableManipulator->createColumn($metaModel->getTableName(), $attributeName, 'blob NULL');
    }
public function handleUpdateAttribute(PostPersistModelEvent $event)
    {
        $model = $event->getModel();

        if (('file' !== $model->getProperty('type'))
            || (!$model->getProperty('file_multiple'))
            || ('tl_metamodel_attribute' !== $event->getEnvironment()->getDataDefinition()->getName())
        ) {
            return;
        }

        $metaModelsName = $this->getFactory()->translateIdToMetaModelName($model->getProperty('pid'));
        $metaModel      = $this->getFactory()->getMetaModel($metaModelsName);
        $attributeName  = $model->getProperty('colname') . '__sort';
        $tableColumns   = $this->connection->getSchemaManager()->listTableColumns($metaModel->getTableName());

        if (\array_key_exists($attributeName, $tableColumns)) {
            return;
        }

        $this->tableManipulator->createColumn($metaModel->getTableName(), $attributeName, 'blob NULL');
    }
public function handleUpdateAttribute ( PostPersistModelEvent $ event ) { $ model = $ event -> getModel ( ) ; if ( ( 'file' !== $ model -> getProperty ( 'type' ) ) || ( ! $ model -> getProperty ( 'file_multiple' ) ) || ( 'tl_metamodel_attribute' !== $ event -> getEnvironment ( ) -> getDataDefinition ( ) -> getName ( ) ) ) { return ; } $ metaModelsName = $ this -> getFactory ( ) -> translateIdToMetaModelName ( $ model -> getProperty ( 'pid' ) ) ; $ metaModel = $ this -> getFactory ( ) -> getMetaModel ( $ metaModelsName ) ; $ attributeName = $ model -> getProperty ( 'colname' ) . '__sort' ; $ tableColumns = $ this -> connection -> getSchemaManager ( ) -> listTableColumns ( $ metaModel -> getTableName ( ) ) ; if ( \ array_key_exists ( $ attributeName , $ tableColumns ) ) { return ; } $ this -> tableManipulator -> createColumn ( $ metaModel -> getTableName ( ) , $ attributeName , 'blob NULL' ) ; }
Handle the update of the file attribute, if switch on for file multiple.

@param PostPersistModelEvent $event The event.

@return void

@throws \Exception If column not exist in the table.
Handle the update of the file attribute if switch on for file multiple .