Доброго времени суток. Бьюсь уже второй день и не могу понять в чём дело... В рантайме ловлю ошибку:
PHP Fatal error: Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'The target-entity Entity\ItemsBags cannot be found in 'Entity\Players#itemsBag'.' in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:762 Stack trace: #0./var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php(1028): Doctrine\ORM\Mapping\MappingException::invalidTargetEntityClass('Entity\\ItemsBag...', 'Entity\\Players', 'itemsBag') #1./var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(272): Doctrine\ORM\Mapping\ClassMetadataInfo->validateAssociations() #2./var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(251): Doctrine\ORM\Mapping\ClassMetadataFactory->validateRuntimeMetadata(Object(Doctrine\ORM\Mapping\ClassMetadata), NULL) #3./var/www/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php(332): Doctrine\ORM\Mapping\ClassMetadataFactory->doLoadM in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php on line 762
При проверке доктрины, и апдейте, всё проходит успешно:
root@comp:# php vendor/bin/doctrine orm:schema:update --force Updating database schema... Database schema updated successfully! "4" queries were executed
root@comp:# php vendor/bin/doctrine orm:validate-schema [Mapping] OK - The mapping files are correct. [Database] OK - The database schema is in sync with the mapping files.
Пробовал очищать кеш, удалять прокси и перегенерировать их, но ничего не дало результатов...
root@comp:# php vendor/bin/doctrine orm:clear-cache:metadata Clearing ALL Metadata cache entries Successfully deleted cache entries. root@comp:# php vendor/bin/doctrine orm:clear-cache:query Clearing ALL Query cache entries Successfully deleted cache entries. root@comp:# php vendor/bin/doctrine orm:clear-cache:result Clearing ALL Result cache entries Successfully deleted cache entries. root@comp:# php vendor/bin/doctrine orm:generate-proxies Processing entity "Entity\Objects" Processing entity "Entity\Weapons" Processing entity "Entity\ItemsBags" Processing entity "Entity\Players" Processing entity "Entity\Translations" Processing entity "Entity\Worlds" Processing entity "Entity\Tiles" Processing entity "Entity\WorldStructures" Proxy classes generated to "/tmp"
Players.php:
namespace Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @Entity
* @Table(name="players")
*
*/
class Players{
...
/**
* @var ItemsBags
*
* @OneToOne(targetEntity="ItemsBags", mappedBy="player")
*/
private $itemsBag;
...
}
ItemsBags.php:
namespace Entity;
use Doctrine\Common\Collections\ArrayCollection;
/**
*
* @Entity
* @Table(name="item_bags")
*
*/
class ItemsBags{
...
/**
* @var Players
*
* @OneToOne(targetEntity="Players", inversedBy="itemsBag")
* @JoinColumn(name="player_id", referencedColumnName="id")
*/
private $player;
...
}
Подскажите пожалуйста, что не так я делаю?