Skip to content

Instantly share code, notes, and snippets.

@bramstroker
Last active August 29, 2015 14:07
Show Gist options
  • Save bramstroker/14d374de1a9766da8eae to your computer and use it in GitHub Desktop.
Save bramstroker/14d374de1a9766da8eae to your computer and use it in GitHub Desktop.
[
'doctrine' => [
'entity_resolver' => [
'orm_default' => [
'resolvers' => [
'Module\\Entity\\EntityBInterface' => 'OptionalModule\\Entity\\EntityB',
]
]
]
]
<?php
namespace Module\Entity;
/**
* @ORM\Entity
*/
class EntityA
{
/**
* @ORM\ManyToOne(targetEntity="Module\Entity\EntityBInterface", fetch="LAZY")
*/
protected $marketingPackage = null;
}
<?php
namespace Module\Entity;
interface EntityBInterface
{
}
<?php
namespace OptionalModule\Entity;
/**
* @ORM\Entity
*/
class EntityB
{
//Fields
}
<?php
$entityA = $entityARepository->find(1);
?>
Now I get the following error message:
The class 'OptionalModule\Entity\EntityB' was not found in the chain configured namespaces Module\Entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment