src/CoreBundle/EventListener/DcGeneral/Table/Dca/ParentTableOptionListener.php
public function handle(GetPropertyOptionsEvent $event)
    {
        if (('tl_metamodel_dca' !== $event->getEnvironment()->getDataDefinition()->getName())
            || ('ptable' !== $event->getPropertyName())) {
            return;
        }

        $tables = [];
        foreach ($this->connection->getSchemaManager()->listTableNames() as $table) {
            $tables[$table] = $table;
        }

        if ('ctable' === $event->getModel()->getProperty('rendertype')) {
            $currentTable = $this->factory->translateIdToMetaModelName($event->getModel()->getProperty('pid'));
            $tables       = array_filter(
                $tables,
                function ($table) use ($currentTable) {
                    return ($currentTable !== $table);
                }
            );
        }

        $event->setOptions($tables);
    }
public function handle(GetPropertyOptionsEvent $event)
    {
        if (('tl_metamodel_dca' !== $event->getEnvironment()->getDataDefinition()->getName())
            || ('ptable' !== $event->getPropertyName())) {
            return;
        }

        $tables = [];
        foreach ($this->connection->getSchemaManager()->listTableNames() as $table) {
            $tables[$table] = $table;
        }

        if ('ctable' === $event->getModel()->getProperty('rendertype')) {
            $currentTable = $this->factory->translateIdToMetaModelName($event->getModel()->getProperty('pid'));
            $tables       = array_filter(
                $tables,
                function ($table) use ($currentTable) {
                    return ($currentTable !== $table);
                }
            );
        }

        $event->setOptions($tables);
    }
public function handle ( GetPropertyOptionsEvent $ event ) { if ( ( 'tl_metamodel_dca' !== $ event -> getEnvironment ( ) -> getDataDefinition ( ) -> getName ( ) ) || ( 'ptable' !== $ event -> getPropertyName ( ) ) ) { return ; } $ tables = [ ] ; foreach ( $ this -> connection -> getSchemaManager ( ) -> listTableNames ( ) as $ table ) { $ tables [ $ table ] = $ table ; } if ( 'ctable' === $ event -> getModel ( ) -> getProperty ( 'rendertype' ) ) { $ currentTable = $ this -> factory -> translateIdToMetaModelName ( $ event -> getModel ( ) -> getProperty ( 'pid' ) ) ; $ tables = array_filter ( $ tables , function ( $ table ) use ( $ currentTable ) { return ( $ currentTable !== $ table ) ; } ) ; } $ event -> setOptions ( $ tables ) ; }
Retrieve a list of all backend sections, like "content", "system" etc.

@param GetPropertyOptionsEvent $event The event.

@return void

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
Retrieve a list of all backend sections like content system etc .