/** * Gets the element of schema meta data for the class from the mapping file. * This will lazily load the mapping file if it is not loaded yet. * * Overridden in order to merger mapping with parent class if 'extended_entity' is provided. * * @param string $className * * @return array The element of schema meta data. */ public function getElement($className) { $result = parent::getElement($className); if (isset($result['extended_entity'])) { $extendedElement = $this->getElement($result['extended_entity']); unset($result['extended_entity']); $result = $this->mergeMappings($extendedElement, $result); } return $result; }
public function loadMetadataForClass($className, ClassMetadata $metadata) { parent::loadMetadataForClass($className, $metadata); // TODO : force use of SearchableClassMetadata instead of ClassMetadata }
<?php require_once './vendor/autoload.php'; $config = (require_once './config/config.php'); use Doctrine\ORM\Tools\Setup; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver; use Slim\Slim; use Slim\Extras\Views\Twig; use Valitron\Validator as V; // ----------------> YAML $namespaces = $config['yaml']['namespaces']; $driver = new SimplifiedYamlDriver($namespaces); $driver->setGlobalBasename('global'); // global.orm.yml // ----------------> Doctrine $isDevMode = true; $dbParams = $config['doctrine']; // ----------------> YAML $yml_config = Setup::createYAMLMetadataConfiguration(array(__DIR__ . "/config/doctrine"), $isDevMode); $entityManager = EntityManager::create($dbParams, $yml_config); $em = $entityManager; // ---------------> Slim $view = new Twig(); $view->twigOptions = $config['slim_twig']; $view->twigExtensions = $config['slim_ext']; $app = new Slim(array('view' => $view)); $app->config($config['slim']); // ---------------> Valitron V::langDir(__DIR__ . '/config/lang/'); V::lang('nl');