mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Entity#parents is not an association with a single join column #5691
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bordeux on GitHub (Sep 7, 2017).
I wrote library to fetch geoNames to database for doctrine. It works fine, but when i want run tests i received this error:
Here is result from travis-ci: https://travis-ci.org/bordeux/geoname-bundle/jobs/270466374
I dont know what that message exactly means, because from my side everything is correct.
This is my definition of paretns field:
And that is definition in hierarchy:
Source: https://github.com/bordeux/geoname-bundle/tree/master/Entity
@Ocramius commented on GitHub (Sep 7, 2017):
What's the full exception trace?
On 7 Sep 2017 12:00, "Krzysztof Bednarczyk" notifications@github.com
wrote:
@bordeux commented on GitHub (Sep 7, 2017):
@Ocramius commented on GitHub (Sep 7, 2017):
What is this doing?
@bordeux commented on GitHub (Sep 7, 2017):
Yeah, that was my issue... , Thank you
@Ocramius commented on GitHub (Sep 7, 2017):
So? What was it?
@bordeux commented on GitHub (Sep 7, 2017):
I did foult here :
/** * @return string[] * @author Chris Bednarczyk */ public function getFieldNames() { $metaData = $this->em->getClassMetadata("BordeuxGeoNameBundle:GeoName"); $result = []; foreach ($metaData->getFieldNames() as $name) { $result[$name] = $metaData->getColumnName($name); } foreach ($metaData->getAssociationNames() as $name) { $result[$name] = $metaData->getSingleAssociationJoinColumnName($name); } return $result; }should be :
/** * @return string[] * @author Chris Bednarczyk */ public function getFieldNames() { $metaData = $this->em->getClassMetadata("BordeuxGeoNameBundle:GeoName"); $result = []; foreach ($metaData->getFieldNames() as $name) { $result[$name] = $metaData->getColumnName($name); } foreach ($metaData->getAssociationNames() as $name) { if($metaData->isSingleValuedAssociation($name)){ $result[$name] = $metaData->getSingleAssociationJoinColumnName($name); } } return $result; }@Ocramius commented on GitHub (Sep 7, 2017):
@bordeux thanks for clarifying!