public function getParentTables(GetPropertyOptionsEvent $event)
{
if ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_dca' || $event->getPropertyName() !== 'ptable') {
return;
}
$currentTable = '';
if ($event->getModel()->getProperty('rendertype') == 'ctable') {
$currentTable = $this->getServiceContainer()->getFactory()->translateIdToMetaModelName($event->getModel()->getProperty('pid'));
}
$tables = array();
foreach ($this->getServiceContainer()->getDatabase()->listTables() as $table) {
if (!($currentTable && $currentTable == $table)) {
$tables[$table] = $table;
}
}
$event->setOptions($tables);
}