public function getMetadata($class) : ObjectMetadata
 {
     if (!is_a($class, MetadataAware::class, true)) {
         throw new \InvalidArgumentException('Invalid class. Accepted only MetadataAware instances');
     }
     /** @var MetadataAware|string $className */
     $className = ClassHelper::getClassName($class);
     // Resolving the container interface
     if ($this->container->contains($className)) {
         $className = $this->container->getClass($className);
     }
     if ($this->storage->contains($className)) {
         $metadata = $this->storage->get($className);
     } else {
         $metadata = $this->modelAnalyzer->analyze($className);
         $this->storage->set($className, $metadata);
     }
     return $metadata;
 }
Exemplo n.º 2
0
 protected function registerRepository($type, $interface, $class)
 {
     if ($this->databaseType === $type) {
         $this->container->registerClass($interface, $class);
     }
 }