/** * {@inheritdoc} */ public function classToTableName($className) { $defaultName = $this->defaultNamer->classToTableName($className); /** * @var NamingStrategy $concurrentNamer */ foreach ($this->concurrentNamers as $concurrentNamer) { if (($newProposal = $concurrentNamer->classToTableName($className)) != $defaultName) { return $newProposal; } } return $defaultName; }
/** * Initializes a new ClassMetadata instance that will hold the object-relational mapping * metadata of the class with the given name. * * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service. */ public function initializeReflection($reflService) { $this->reflClass = $reflService->getClass($this->name); $this->namespace = $reflService->getClassNamespace($this->name); if ($this->reflClass) { $this->name = $this->rootEntityName = $this->reflClass->getName(); } $this->table['name'] = $this->namingStrategy->classToTableName($this->name); }
/** * @dataProvider dataClassToTableName */ public function testClassToTableName(NamingStrategy $strategy, $expected, $className) { $this->assertEquals($expected, $strategy->classToTableName($className)); }