src/Events/DatabaseBackedListener.php
protected function createInstance(CreateMetaModelEvent $event, $arrData)
    {
        if (!$this->createInstanceViaLegacyFactory($event, $arrData)) {
            $metaModel = new MetaModel($arrData, $this->dispatcher, $this->database);
            $metaModel->setServiceContainer(function () {
                return $this->getServiceContainer();
            }, false);
            $event->setMetaModel($metaModel);
        }

        if ($event->getMetaModel()) {
            $this->instancesByTable[$event->getMetaModelName()]     = $event->getMetaModel();
            $this->instancesById[$event->getMetaModel()->get('id')] = $event->getMetaModel();
        }
    }
protected function createInstance(CreateMetaModelEvent $event, $arrData)
    {
        if (!$this->createInstanceViaLegacyFactory($event, $arrData)) {
            $metaModel = new MetaModel($arrData, $this->dispatcher, $this->database);
            $metaModel->setServiceContainer(function () {
                return $this->getServiceContainer();
            }, false);
            $event->setMetaModel($metaModel);
        }

        if ($event->getMetaModel()) {
            $this->instancesByTable[$event->getMetaModelName()]     = $event->getMetaModel();
            $this->instancesById[$event->getMetaModel()->get('id')] = $event->getMetaModel();
        }
    }
Create a MetaModel instance with the given information.

@param CreateMetaModelEvent $event   The event.

@param array                $arrData The meta information for the MetaModel.

@return void