Last active
August 29, 2015 14:07
-
-
Save bramstroker/14d374de1a9766da8eae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
'doctrine' => [ | |
'entity_resolver' => [ | |
'orm_default' => [ | |
'resolvers' => [ | |
'Module\\Entity\\EntityBInterface' => 'OptionalModule\\Entity\\EntityB', | |
] | |
] | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Module\Entity; | |
/** | |
* @ORM\Entity | |
*/ | |
class EntityA | |
{ | |
/** | |
* @ORM\ManyToOne(targetEntity="Module\Entity\EntityBInterface", fetch="LAZY") | |
*/ | |
protected $marketingPackage = null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Module\Entity; | |
interface EntityBInterface | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace OptionalModule\Entity; | |
/** | |
* @ORM\Entity | |
*/ | |
class EntityB | |
{ | |
//Fields | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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