@@ 172-195 (lines=24) @@ | ||
169 | $this->addFieldResult($alias, $columnAlias, $property->getName()); |
|
170 | break; |
|
171 | ||
172 | case ($property instanceof ToOneAssociationMetadata && $property->isOwningSide()): |
|
173 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
|
174 | ||
175 | foreach ($property->getJoinColumns() as $joinColumn) { |
|
176 | /** @var JoinColumnMetadata $joinColumn */ |
|
177 | $columnName = $joinColumn->getColumnName(); |
|
178 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
|
179 | $columnAlias = $platform->getSQLResultCasing( |
|
180 | $this->getColumnAlias($columnName, $renameMode, $customRenameColumns) |
|
181 | ); |
|
182 | ||
183 | if (isset($this->metaMappings[$columnAlias])) { |
|
184 | throw new \InvalidArgumentException( |
|
185 | sprintf("The column '%s' conflicts with another column in the mapper.", $columnName) |
|
186 | ); |
|
187 | } |
|
188 | ||
189 | if (! $joinColumn->getType()) { |
|
190 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
|
191 | } |
|
192 | ||
193 | $this->addMetaResult($alias, $columnAlias, $columnName, $property->isPrimaryKey(), $joinColumn->getType()); |
|
194 | } |
|
195 | break; |
|
196 | } |
|
197 | } |
|
198 | } |
|
@@ 404-425 (lines=22) @@ | ||
401 | $this->addFieldResult($alias, $columnAlias, $property->getName()); |
|
402 | break; |
|
403 | ||
404 | case ($property instanceof ToOneAssociationMetadata && $property->isOwningSide()): |
|
405 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
|
406 | ||
407 | foreach ($property->getJoinColumns() as $joinColumn) { |
|
408 | /** @var JoinColumnMetadata $joinColumn */ |
|
409 | $columnName = $joinColumn->getColumnName(); |
|
410 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
|
411 | $columnAlias = $platform->getSQLResultCasing($columnName); |
|
412 | ||
413 | if (isset($this->metaMappings[$columnAlias])) { |
|
414 | throw new \InvalidArgumentException( |
|
415 | sprintf("The column '%s' conflicts with another column in the mapper.", $columnName) |
|
416 | ); |
|
417 | } |
|
418 | ||
419 | if (! $joinColumn->getType()) { |
|
420 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
|
421 | } |
|
422 | ||
423 | $this->addMetaResult($alias, $columnAlias, $columnName, $property->isPrimaryKey(), $joinColumn->getType()); |
|
424 | } |
|
425 | break; |
|
426 | } |
|
427 | } |
|
428 | } |