コード例 #1
0
 /**
  * @param string $class
  *
  * @return string
  */
 public function resolveClass($class)
 {
     if ($class === null) {
         return $class;
     }
     // Check for namespace alias
     if (strpos($class, ':') !== false) {
         list($namespaceAlias, $simpleClassName) = explode(':', $class);
         $class = $this->registry->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
     }
     return $this->entity_map->get($class, $class);
 }
コード例 #2
0
 function let(ManagerRegistry $registry, EntityMapService $entity_map)
 {
     $entity_map->has('MappedInterface')->willReturn(true);
     $entity_map->get('MappedInterface', Argument::any())->willReturn('MappedEntity');
     $entity_map->has('MappedAbstract')->willReturn(true);
     $entity_map->get('MappedAbstract', Argument::any())->willReturn('AnotherEntity');
     $entity_map->get('ConcreteEntity', Argument::any())->will(function ($args) {
         return $args[1];
     });
     $this->beConstructedWith($registry, $entity_map);
 }