src/CoreBundle/EventListener/DcGeneral/Table/DcaSettingCondition/AbstractListener.php
public function getMetaModel(EnvironmentInterface $interface)
    {
        $metaModelId = $this->connection->createQueryBuilder()
            ->select('d.pid')
            ->from('tl_metamodel_dca', 'd')
            ->leftJoin('d', 'tl_metamodel_dcasetting', 's', '(d.id=s.pid)')
            ->where('(s.id=:id)')
            ->setParameter('id', ModelId::fromSerialized($interface->getInputProvider()->getParameter('pid'))->getId())
            ->execute();

        if ($tableName = $this->factory->translateIdToMetaModelName($metaModelId = $metaModelId->fetchColumn())) {
            return $this->factory->getMetaModel($tableName);
        }

        throw new \RuntimeException('Could not retrieve MetaModel ' . $metaModelId);
    }
public function getMetaModel(EnvironmentInterface $interface)
    {
        $metaModelId = $this->connection->createQueryBuilder()
            ->select('d.pid')
            ->from('tl_metamodel_dca', 'd')
            ->leftJoin('d', 'tl_metamodel_dcasetting', 's', '(d.id=s.pid)')
            ->where('(s.id=:id)')
            ->setParameter('id', ModelId::fromSerialized($interface->getInputProvider()->getParameter('pid'))->getId())
            ->execute();

        if ($tableName = $this->factory->translateIdToMetaModelName($metaModelId = $metaModelId->fetchColumn())) {
            return $this->factory->getMetaModel($tableName);
        }

        throw new \RuntimeException('Could not retrieve MetaModel ' . $metaModelId);
    }
Retrieve the MetaModel attached to the model condition setting.

@param EnvironmentInterface $interface The environment.

@return \MetaModels\IMetaModel

@throws \RuntimeException Throws if could not retrieve metamodel.