Skip to content
Permalink
Browse files

Merge pull request #50 from ergebnis/fix/meta-data

Fix: Compose meta data instead of entity manager
  • Loading branch information
localheinz committed Mar 15, 2020
2 parents b7315ab + 47b609e commit fe49e8f627a6b5f6b468391826c48f923c6f8b3b
Showing with 9 additions and 3 deletions.
  1. +2 −2 src/EntityDef.php
  2. +7 −1 src/FixtureFactory.php
@@ -33,11 +33,11 @@ final class EntityDef

private $config;

public function __construct(ORM\EntityManagerInterface $em, $name, $type, array $fieldDefs, array $config)
public function __construct(ORM\Mapping\ClassMetadata $metadata, $name, $type, array $fieldDefs, array $config)
{
$this->name = $name;
$this->entityType = $type;
$this->metadata = $em->getClassMetadata($type);
$this->metadata = $metadata;
$this->fieldDefs = [];
$this->config = $config;

@@ -225,7 +225,13 @@ public function defineEntity($name, array $fieldDefs = [], array $config = [])
throw new \Exception("Unknown entity type: {$type}");
}

$this->entityDefs[$name] = new EntityDef($this->em, $name, $type, $fieldDefs, $config);
$this->entityDefs[$name] = new EntityDef(
$metadata,
$name,
$type,
$fieldDefs,
$config
);

return $this;
}

0 comments on commit fe49e8f

Please sign in to comment.
You can’t perform that action at this time.