@@ -55,9 +55,9 @@ |
||
55 | 55 | $data = $this->uow->getOriginalEntityData($entity); |
56 | 56 | $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ? |
57 | 57 | |
58 | - if ($metadata->isVersioned()) { |
|
59 | - $data[$metadata->versionProperty->getName()] = $metadata->versionProperty->getValue($entity); |
|
60 | - } |
|
58 | + if ($metadata->isVersioned()) { |
|
59 | + $data[$metadata->versionProperty->getName()] = $metadata->versionProperty->getValue($entity); |
|
60 | + } |
|
61 | 61 | |
62 | 62 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $association) { |
63 | 63 | if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Cache; |
6 | 6 | |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | foreach ($metadata->getDeclaredPropertiesIterator() as $name => $association) { |
63 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
63 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
64 | 64 | continue; |
65 | 65 | } |
66 | 66 | |
67 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
67 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
68 | 68 | unset($data[$name]); |
69 | 69 | |
70 | 70 | continue; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
75 | 75 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
76 | 76 | |
77 | - if (! $association->getCache()) { |
|
77 | + if ( ! $association->getCache()) { |
|
78 | 78 | $owningAssociation = ! $association->isOwningSide() |
79 | 79 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
80 | 80 | : $association; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | continue; |
123 | 123 | } |
124 | 124 | |
125 | - if (! $association->isPrimaryKey()) { |
|
125 | + if ( ! $association->isPrimaryKey()) { |
|
126 | 126 | $targetClass = StaticClassNameConverter::getClass($data[$name]); |
127 | 127 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
128 | 128 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
172 | 172 | ); |
173 | 173 | |
174 | - if (! $isEagerLoad) { |
|
174 | + if ( ! $isEagerLoad) { |
|
175 | 175 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
176 | 176 | |
177 | 177 | continue; |
@@ -10,40 +10,40 @@ discard block |
||
10 | 10 | class DDC7067Test extends \Doctrine\Tests\OrmFunctionalTestCase |
11 | 11 | { |
12 | 12 | |
13 | - public function setUp() |
|
14 | - { |
|
15 | - $this->enableSecondLevelCache(); |
|
16 | - parent::setUp(); |
|
13 | + public function setUp() |
|
14 | + { |
|
15 | + $this->enableSecondLevelCache(); |
|
16 | + parent::setUp(); |
|
17 | 17 | |
18 | - try { |
|
19 | - $this->setUpEntitySchema([ |
|
20 | - DDC7067Entity::class, |
|
21 | - ]); |
|
22 | - } catch (SchemaException $e) { |
|
23 | - } |
|
24 | - } |
|
18 | + try { |
|
19 | + $this->setUpEntitySchema([ |
|
20 | + DDC7067Entity::class, |
|
21 | + ]); |
|
22 | + } catch (SchemaException $e) { |
|
23 | + } |
|
24 | + } |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * @group DDC-7067 |
|
29 | - */ |
|
30 | - public function testSLCWithVersion() |
|
31 | - { |
|
32 | - $entity = new DDC7067Entity(); |
|
33 | - $entity->update = new \DateTime(); |
|
34 | - $this->em->persist($entity); |
|
35 | - $this->em->flush(); |
|
36 | - $this->em->clear(); |
|
27 | + /** |
|
28 | + * @group DDC-7067 |
|
29 | + */ |
|
30 | + public function testSLCWithVersion() |
|
31 | + { |
|
32 | + $entity = new DDC7067Entity(); |
|
33 | + $entity->update = new \DateTime(); |
|
34 | + $this->em->persist($entity); |
|
35 | + $this->em->flush(); |
|
36 | + $this->em->clear(); |
|
37 | 37 | |
38 | - /** @var EntityRepository $er */ |
|
39 | - $er = $this->em->getRepository(DDC7067Entity::class); |
|
40 | - /** @var DDC7067Entity $notCached */ |
|
41 | - $notCached = $er->find($entity->id); |
|
42 | - self::assertNotNull($notCached->version, "version for already cached entity by persister above must be not null. This will fail"); |
|
43 | - $notCached->update = new \DateTime(); |
|
44 | - $this->em->flush(); |
|
45 | - $this->em->clear(); |
|
46 | - } |
|
38 | + /** @var EntityRepository $er */ |
|
39 | + $er = $this->em->getRepository(DDC7067Entity::class); |
|
40 | + /** @var DDC7067Entity $notCached */ |
|
41 | + $notCached = $er->find($entity->id); |
|
42 | + self::assertNotNull($notCached->version, "version for already cached entity by persister above must be not null. This will fail"); |
|
43 | + $notCached->update = new \DateTime(); |
|
44 | + $this->em->flush(); |
|
45 | + $this->em->clear(); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | } |
49 | 49 | |
@@ -53,22 +53,22 @@ discard block |
||
53 | 53 | */ |
54 | 54 | class DDC7067Entity |
55 | 55 | { |
56 | - /** |
|
57 | - * @ORM\Id |
|
58 | - * @ORM\GeneratedValue |
|
59 | - * @ORM\Column(type="integer") |
|
60 | - */ |
|
61 | - public $id; |
|
62 | - /** |
|
63 | - * @var \DateTime |
|
64 | - * @ORM\Column(type="datetime") |
|
65 | - */ |
|
66 | - public $update; |
|
67 | - /** |
|
68 | - * @var \DateTime |
|
69 | - * @ORM\Column(type="datetime") |
|
70 | - * @ORM\Version() |
|
71 | - */ |
|
72 | - public $version; |
|
56 | + /** |
|
57 | + * @ORM\Id |
|
58 | + * @ORM\GeneratedValue |
|
59 | + * @ORM\Column(type="integer") |
|
60 | + */ |
|
61 | + public $id; |
|
62 | + /** |
|
63 | + * @var \DateTime |
|
64 | + * @ORM\Column(type="datetime") |
|
65 | + */ |
|
66 | + public $update; |
|
67 | + /** |
|
68 | + * @var \DateTime |
|
69 | + * @ORM\Column(type="datetime") |
|
70 | + * @ORM\Version() |
|
71 | + */ |
|
72 | + public $version; |
|
73 | 73 | |
74 | 74 | } |
75 | 75 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
6 | 6 |