#1176 DDC-3378 - minor CS fixes (imports, spacing, IDE hints)
This commit is contained in:
parent
8305649a45
commit
a67332fb51
2 changed files with 9 additions and 8 deletions
|
@ -40,8 +40,7 @@ class AssignedGenerator extends AbstractIdGenerator
|
||||||
*
|
*
|
||||||
* @throws \Doctrine\ORM\ORMException
|
* @throws \Doctrine\ORM\ORMException
|
||||||
*/
|
*/
|
||||||
public function generate(
|
public function generate(EntityManager $em, $entity)
|
||||||
EntityManager $em, $entity)
|
|
||||||
{
|
{
|
||||||
$class = $em->getClassMetadata(get_class($entity));
|
$class = $em->getClassMetadata(get_class($entity));
|
||||||
$idFields = $class->getIdentifierFieldNames();
|
$idFields = $class->getIdentifierFieldNames();
|
||||||
|
|
|
@ -36,22 +36,22 @@ final class IdentifierFlattener
|
||||||
/**
|
/**
|
||||||
* The UnitOfWork used to coordinate object-level transactions.
|
* The UnitOfWork used to coordinate object-level transactions.
|
||||||
*
|
*
|
||||||
* @var \Doctrine\ORM\UnitOfWork
|
* @var UnitOfWork
|
||||||
*/
|
*/
|
||||||
private $unitOfWork;
|
private $unitOfWork;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The metadata factory, used to retrieve the ORM metadata of entity classes.
|
* The metadata factory, used to retrieve the ORM metadata of entity classes.
|
||||||
*
|
*
|
||||||
* @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
|
* @var ClassMetadataFactory
|
||||||
*/
|
*/
|
||||||
private $metadataFactory;
|
private $metadataFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes a new IdentifierFlattener instance, bound to the given EntityManager.
|
* Initializes a new IdentifierFlattener instance, bound to the given EntityManager.
|
||||||
*
|
*
|
||||||
* @param \Doctrine\ORM\UnitOfWork $unitOfWork
|
* @param UnitOfWork $unitOfWork
|
||||||
* @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory
|
* @param ClassMetadataFactory $metadataFactory
|
||||||
*/
|
*/
|
||||||
public function __construct(UnitOfWork $unitOfWork, ClassMetadataFactory $metadataFactory)
|
public function __construct(UnitOfWork $unitOfWork, ClassMetadataFactory $metadataFactory)
|
||||||
{
|
{
|
||||||
|
@ -62,8 +62,9 @@ final class IdentifierFlattener
|
||||||
/**
|
/**
|
||||||
* convert foreign identifiers into scalar foreign key values to avoid object to string conversion failures.
|
* convert foreign identifiers into scalar foreign key values to avoid object to string conversion failures.
|
||||||
*
|
*
|
||||||
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
|
* @param ClassMetadata $class
|
||||||
* @param array $id
|
* @param array $id
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function flattenIdentifier(ClassMetadata $class, array $id)
|
public function flattenIdentifier(ClassMetadata $class, array $id)
|
||||||
|
@ -72,6 +73,7 @@ final class IdentifierFlattener
|
||||||
|
|
||||||
foreach ($id as $idField => $idValue) {
|
foreach ($id as $idField => $idValue) {
|
||||||
if (isset($class->associationMappings[$idField]) && is_object($idValue)) {
|
if (isset($class->associationMappings[$idField]) && is_object($idValue)) {
|
||||||
|
/* @var $targetClassMetadata ClassMetadata */
|
||||||
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
|
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
|
||||||
$class->associationMappings[$idField]['targetEntity']
|
$class->associationMappings[$idField]['targetEntity']
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue