src/Events/DatabaseBackedListener.php
public function createMetaModel(CreateMetaModelEvent $event)
    {
        if ($event->getMetaModel() !== null) {
            return;
        }

        if (isset($this->instancesByTable[$event->getMetaModelName()])) {
            $event->setMetaModel($this->instancesByTable[$event->getMetaModelName()]);

            return;
        }

        $table = $this
            ->database
            ->createQueryBuilder()
            ->select('*')
            ->from('tl_metamodel')
            ->where('tableName=:tableName')
            ->setParameter('tableName', $event->getMetaModelName())
            ->setMaxResults(1)
            ->execute()
            ->fetch(\PDO::FETCH_ASSOC);

        if ($table) {
            $table['system_columns'] = $this->systemColumns;

            $this->createInstance($event, $table);
        }
    }
public function createMetaModel(CreateMetaModelEvent $event)
    {
        if ($event->getMetaModel() !== null) {
            return;
        }

        if (isset($this->instancesByTable[$event->getMetaModelName()])) {
            $event->setMetaModel($this->instancesByTable[$event->getMetaModelName()]);

            return;
        }

        $table = $this
            ->database
            ->createQueryBuilder()
            ->select('*')
            ->from('tl_metamodel')
            ->where('tableName=:tableName')
            ->setParameter('tableName', $event->getMetaModelName())
            ->setMaxResults(1)
            ->execute()
            ->fetch(\PDO::FETCH_ASSOC);

        if ($table) {
            $table['system_columns'] = $this->systemColumns;

            $this->createInstance($event, $table);
        }
    }
Create a MetaModel instance.

@param CreateMetaModelEvent $event The event.

@return void