1
0
mirror of synced 2024-12-05 03:06:05 +03:00

#1176 DDC-3378 - minor CS fixes (imports, spacing, IDE hints)

This commit is contained in:
Marco Pivetta 2015-01-22 12:11:03 +01:00
parent 8305649a45
commit a67332fb51
2 changed files with 9 additions and 8 deletions

View File

@ -40,8 +40,7 @@ class AssignedGenerator extends AbstractIdGenerator
*
* @throws \Doctrine\ORM\ORMException
*/
public function generate(
EntityManager $em, $entity)
public function generate(EntityManager $em, $entity)
{
$class = $em->getClassMetadata(get_class($entity));
$idFields = $class->getIdentifierFieldNames();

View File

@ -36,22 +36,22 @@ final class IdentifierFlattener
/**
* The UnitOfWork used to coordinate object-level transactions.
*
* @var \Doctrine\ORM\UnitOfWork
* @var UnitOfWork
*/
private $unitOfWork;
/**
* The metadata factory, used to retrieve the ORM metadata of entity classes.
*
* @var \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
* @var ClassMetadataFactory
*/
private $metadataFactory;
/**
* Initializes a new IdentifierFlattener instance, bound to the given EntityManager.
*
* @param \Doctrine\ORM\UnitOfWork $unitOfWork
* @param \Doctrine\Common\Persistence\Mapping\ClassMetadataFactory $metadataFactory
* @param UnitOfWork $unitOfWork
* @param 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.
*
* @param \Doctrine\ORM\Mapping\ClassMetadata $class
* @param array $id
* @param ClassMetadata $class
* @param array $id
*
* @return array
*/
public function flattenIdentifier(ClassMetadata $class, array $id)
@ -72,6 +73,7 @@ final class IdentifierFlattener
foreach ($id as $idField => $idValue) {
if (isset($class->associationMappings[$idField]) && is_object($idValue)) {
/* @var $targetClassMetadata ClassMetadata */
$targetClassMetadata = $this->metadataFactory->getMetadataFor(
$class->associationMappings[$idField]['targetEntity']
);