public function defineEntity($name, array $fieldDefs = array(), array $config = array())
{
if (isset($this->entityDefs[$name])) {
throw new Exception("Entity '{$name}' already defined in fixture factory");
}
$type = $this->addNamespace($name);
if (!class_exists($type, true)) {
throw new Exception("Not a class: {$type}");
}
$metadata = $this->em->getClassMetadata($type);
if (!isset($metadata)) {
throw new Exception("Unknown entity type: {$type}");
}
$this->entityDefs[$name] = new EntityDef($this->em, $name, $type, $fieldDefs, $config);
return $this;
}