Passed
Push — master ( c18183...2de6c8 )
by Michael
11:46
created

testInvalidReferencedJoinTableColumnIsNotPrimary()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Tools;
6
7
use Doctrine\ORM\Annotation as ORM;
8
use Doctrine\ORM\EntityManagerInterface;
9
use Doctrine\ORM\Tools\SchemaValidator;
10
use Doctrine\Tests\OrmTestCase;
11
12
class SchemaValidatorTest extends OrmTestCase
13
{
14
    /**
15
     * @var EntityManagerInterface
16
     */
17
    private $em;
18
19
    /**
20
     * @var SchemaValidator
21
     */
22
    private $validator;
23
24
    public function setUp()
25
    {
26
        $this->em = $this->getTestEntityManager();
27
        $this->validator = new SchemaValidator($this->em);
28
    }
29
30
    /**
31
     * @dataProvider modelSetProvider
32
     */
33
    public function testCmsModelSet(string $path)
34
    {
35
        $this->em->getConfiguration()
36
                 ->getMetadataDriverImpl()
37
                 ->addPaths([$path]);
0 ignored issues
show
Bug introduced by
The method addPaths() does not exist on Doctrine\ORM\Mapping\Driver\MappingDriver. It seems like you code against a sub-type of Doctrine\ORM\Mapping\Driver\MappingDriver such as Doctrine\ORM\Mapping\Driver\AnnotationDriver or Doctrine\ORM\Mapping\Dri...tation\AnnotationDriver. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

37
                 ->/** @scrutinizer ignore-call */ addPaths([$path]);
Loading history...
38
39
        self::assertEmpty($this->validator->validateMapping());
40
    }
41
42
    public function modelSetProvider(): array
43
    {
44
        return [
45
            'cms'        => [__DIR__ . '/../../Models/CMS'],
46
            'company'    => [__DIR__ . '/../../Models/Company'],
47
            'ecommerce'  => [__DIR__ . '/../../Models/ECommerce'],
48
            'forum'      => [__DIR__ . '/../../Models/Forum'],
49
            'navigation' => [__DIR__ . '/../../Models/Navigation'],
50
            'routing'    => [__DIR__ . '/../../Models/Routing'],
51
        ];
52
    }
53
54
    /**
55
     * @group DDC-1439
56
     */
57
    public function testInvalidManyToManyJoinColumnSchema()
58
    {
59
        $class1 = $this->em->getClassMetadata(InvalidEntity1::class);
60
        $class2 = $this->em->getClassMetadata(InvalidEntity2::class);
0 ignored issues
show
Unused Code introduced by
The assignment to $class2 is dead and can be removed.
Loading history...
61
62
        $errors = $this->validator->validateClass($class1);
0 ignored issues
show
Bug introduced by
$class1 of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

62
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class1);
Loading history...
63
64
        $message1 = "The inverse join columns of the many-to-many table '%s' have to contain to ALL identifier columns of the target entity '%s', however '%s' are missing.";
65
        $message2 = "The join columns of the many-to-many table '%s' have to contain to ALL identifier columns of the source entity '%s', however '%s' are missing.";
66
67
        self::assertEquals(
68
            [
69
                sprintf($message1, 'Entity1Entity2', InvalidEntity2::class, 'key4'),
70
                sprintf($message2, 'Entity1Entity2', InvalidEntity1::class, 'key2'),
71
            ],
72
            $errors
73
        );
74
    }
75
76
    /**
77
     * @group DDC-1439
78
     */
79
    public function testInvalidToOneJoinColumnSchema()
80
    {
81
        $class1 = $this->em->getClassMetadata(InvalidEntity1::class);
0 ignored issues
show
Unused Code introduced by
The assignment to $class1 is dead and can be removed.
Loading history...
82
        $class2 = $this->em->getClassMetadata(InvalidEntity2::class);
83
84
        $errors = $this->validator->validateClass($class2);
0 ignored issues
show
Bug introduced by
$class2 of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

84
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class2);
Loading history...
85
86
        $message1 = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
87
        $message2 = "The join columns of the association '%s' have to match to ALL identifier columns of the target entity '%s', however '%s' are missing.";
88
89
        self::assertEquals(
90
            [
91
                sprintf($message1, 'id', InvalidEntity1::class),
92
                sprintf($message2, 'assoc', InvalidEntity1::class, "key1', 'key2"),
93
            ],
94
            $errors
95
        );
96
    }
97
98
    /**
99
     * @group DDC-1587
100
     */
101
    public function testValidOneToOneAsIdentifierSchema()
102
    {
103
        $class1 = $this->em->getClassMetadata(DDC1587ValidEntity2::class);
104
        $class2 = $this->em->getClassMetadata(DDC1587ValidEntity1::class);
0 ignored issues
show
Unused Code introduced by
The assignment to $class2 is dead and can be removed.
Loading history...
105
106
        $errors = $this->validator->validateClass($class1);
0 ignored issues
show
Bug introduced by
$class1 of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

106
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class1);
Loading history...
107
108
        self::assertEquals([], $errors);
109
    }
110
111
    /**
112
     * @group DDC-1649
113
     */
114
    public function testInvalidTripleAssociationAsKeyMapping()
115
    {
116
        $classThree = $this->em->getClassMetadata(DDC1649Three::class);
117
        $errors = $this->validator->validateClass($classThree);
0 ignored issues
show
Bug introduced by
$classThree of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

117
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $classThree);
Loading history...
118
119
        $message1 = "Cannot map association %s#%s as identifier, because the target entity '%s' also maps an association as identifier.";
120
        $message2 = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
121
122
        self::assertEquals(
123
            [
124
                sprintf($message1, DDC1649Three::class, 'two', DDC1649Two::class),
125
                sprintf($message2, 'id', DDC1649Two::class),
126
            ],
127
            $errors
128
        );
129
    }
130
131
    /**
132
     * @group DDC-3274
133
     */
134
    public function testInvalidBiDirectionalRelationMappingMissingInversedByAttribute()
135
    {
136
        $class = $this->em->getClassMetadata(DDC3274One::class);
137
        $errors = $this->validator->validateClass($class);
0 ignored issues
show
Bug introduced by
$class of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

137
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class);
Loading history...
138
139
        $message = "The property %s#%s is on the inverse side of a bi-directional relationship, but the "
140
            . "specified mappedBy association on the target-entity %s#%s does not contain the required 'inversedBy=\"%s\"' attribute.";
141
142
        self::assertEquals(
143
            [
144
                sprintf($message, DDC3274One::class, 'two', DDC3274Two::class, 'one', 'two')
145
            ],
146
            $errors
147
        );
148
    }
149
150
    /**
151
     * @group DDC-3322
152
     */
153
    public function testInvalidOrderByInvalidField()
154
    {
155
        $class = $this->em->getClassMetadata(DDC3322One::class);
156
        $errors = $this->validator->validateClass($class);
0 ignored issues
show
Bug introduced by
$class of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

156
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class);
Loading history...
157
158
        $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'.";
159
160
        self::assertEquals(
161
            [
162
                sprintf($message, DDC3322One::class, 'invalidAssoc', 'invalidField', DDC3322ValidEntity1::class)
163
            ],
164
            $errors
165
        );
166
    }
167
168
    /**
169
     * @group DDC-3322
170
     */
171
    public function testInvalidOrderByCollectionValuedAssociation()
172
    {
173
        $class = $this->em->getClassMetadata(DDC3322Two::class);
174
        $errors = $this->validator->validateClass($class);
0 ignored issues
show
Bug introduced by
$class of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

174
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class);
Loading history...
175
176
        $message = "The association %s#%s is ordered by a property '%s' on '%s' that is a collection-valued association.";
177
178
        self::assertEquals(
179
            [
180
                sprintf($message, DDC3322Two::class, 'invalidAssoc', 'oneToMany', DDC3322ValidEntity1::class)
181
            ],
182
            $errors
183
        );
184
    }
185
186
    /**
187
     * @group DDC-3322
188
     */
189
    public function testInvalidOrderByAssociationInverseSide()
190
    {
191
        $class = $this->em->getClassMetadata(DDC3322Three::class);
192
        $errors = $this->validator->validateClass($class);
0 ignored issues
show
Bug introduced by
$class of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

192
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class);
Loading history...
193
194
        $message = "The association %s#%s is ordered by a property '%s' on '%s' that is the inverse side of an association.";
195
196
        self::assertEquals(
197
            [
198
                sprintf($message, DDC3322Three::class, 'invalidAssoc', 'oneToOneInverse', DDC3322ValidEntity1::class)
199
            ],
200
            $errors
201
        );
202
    }
203
204
    public function testInvalidReferencedJoinTableColumnIsNotPrimary() : void
205
    {
206
        $class = $this->em->getClassMetadata(InvalidEntity3::class);
207
        $errors = $this->validator->validateClass($class);
0 ignored issues
show
Bug introduced by
$class of type Doctrine\Common\Persistence\Mapping\ClassMetadata is incompatible with the type Doctrine\ORM\Mapping\ClassMetadata expected by parameter $class of Doctrine\ORM\Tools\Schem...idator::validateClass(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

207
        $errors = $this->validator->validateClass(/** @scrutinizer ignore-type */ $class);
Loading history...
208
209
        $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
210
211
        self::assertEquals(
212
            [
213
                sprintf($message, 'nonId4', InvalidEntity4::class)
214
            ],
215
            $errors
216
        );
217
    }
218
}
219
220
/**
221
 * @ORM\Entity
222
 */
223
class InvalidEntity1
224
{
225
    /**
226
     * @ORM\Id @ORM\Column
227
     */
228
    protected $key1;
229
    /**
230
     * @ORM\Id @ORM\Column
231
     */
232
    protected $key2;
233
    /**
234
     * @ORM\ManyToMany (targetEntity=InvalidEntity2::class)
235
     * @ORM\JoinTable (name="Entity1Entity2",
236
     *      joinColumns={@ORM\JoinColumn(name="key1", referencedColumnName="key1")},
237
     *      inverseJoinColumns={@ORM\JoinColumn(name="key3", referencedColumnName="key3")}
238
     *      )
239
     */
240
    protected $entity2;
241
}
242
243
/**
244
 * @ORM\Entity
245
 */
246
class InvalidEntity2
247
{
248
    /**
249
     * @ORM\Id @ORM\Column
250
     */
251
    protected $key3;
252
253
    /**
254
     * @ORM\Id @ORM\Column
255
     */
256
    protected $key4;
257
258
    /**
259
     * @ORM\ManyToOne(targetEntity=InvalidEntity1::class)
260
     */
261
    protected $assoc;
262
}
263
264
/**
265
 * @ORM\Entity
266
 */
267
class InvalidEntity3
268
{
269
    /**
270
     * @ORM\Id @ORM\Column
271
     */
272
    protected $id3;
273
274
    /**
275
     * @ORM\ManyToMany(targetEntity=InvalidEntity4::class)
276
     * @ORM\JoinTable(name="invalid_entity_3_4")
277
     * @ORM\JoinTable (name="Entity1Entity2",
278
     *      joinColumns={@ORM\JoinColumn(name="id3_fk", referencedColumnName="id3")},
279
     *      inverseJoinColumns={@ORM\JoinColumn(name="id4_fk", referencedColumnName="nonId4")}
280
     * )
281
     */
282
    protected $invalid4;
283
}
284
285
/**
286
 * @ORM\Entity
287
 */
288
class InvalidEntity4
289
{
290
    /**
291
     * @ORM\Id @ORM\Column
292
     */
293
    protected $id4;
294
    /**
295
     * @ORM\Column
296
     */
297
    protected $nonId4;
298
}
299
300
/**
301
 * @ORM\Entity(repositoryClass="Entity\Repository\Agent")
302
 * @ORM\Table(name="agent")
303
 */
304
class DDC1587ValidEntity1
305
{
306
    /**
307
     * @var int
308
     *
309
     * @ORM\Id @ORM\GeneratedValue
310
     * @ORM\Column(name="pk", type="integer")
311
     */
312
    private $pk;
0 ignored issues
show
introduced by
The private property $pk is not used, and could be removed.
Loading history...
313
314
    /**
315
     * @var string
316
     *
317
     * @ORM\Column(name="name", type="string", length=32)
318
     */
319
    private $name;
0 ignored issues
show
introduced by
The private property $name is not used, and could be removed.
Loading history...
320
321
    /**
322
     * @var Identifier
0 ignored issues
show
Bug introduced by
The type Doctrine\Tests\ORM\Tools\Identifier was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
323
     *
324
     * @ORM\OneToOne(targetEntity=DDC1587ValidEntity2::class, cascade={"all"}, mappedBy="agent")
325
     * @ORM\JoinColumn(name="pk", referencedColumnName="pk_agent")
326
     */
327
    private $identifier;
0 ignored issues
show
introduced by
The private property $identifier is not used, and could be removed.
Loading history...
328
}
329
330
/**
331
 * @ORM\Entity
332
 * @ORM\Table
333
 */
334
class DDC1587ValidEntity2
335
{
336
    /**
337
     * @var DDC1587ValidEntity1
338
     *
339
     * @ORM\Id
340
     * @ORM\OneToOne(targetEntity=DDC1587ValidEntity1::class, inversedBy="identifier")
341
     * @ORM\JoinColumn(name="pk_agent", referencedColumnName="pk", nullable=false)
342
     */
343
    private $agent;
0 ignored issues
show
introduced by
The private property $agent is not used, and could be removed.
Loading history...
344
345
    /**
346
     * @var string
347
     *
348
     * @ORM\Column(name="num", type="string", length=16, nullable=true)
349
     */
350
    private $num;
0 ignored issues
show
introduced by
The private property $num is not used, and could be removed.
Loading history...
351
}
352
353
/**
354
 * @ORM\Entity
355
 */
356
class DDC1649One
357
{
358
    /**
359
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
360
     */
361
    public $id;
362
}
363
364
/**
365
 * @ORM\Entity
366
 */
367
class DDC1649Two
368
{
369
    /** @ORM\Id @ORM\ManyToOne(targetEntity=DDC1649One::class)@ORM\JoinColumn(name="id", referencedColumnName="id")  */
370
    public $one;
371
}
372
373
/**
374
 * @ORM\Entity
375
 */
376
class DDC1649Three
377
{
378
    /** @ORM\Id @ORM\ManyToOne(targetEntity=DDC1649Two::class) @ORM\JoinColumn(name="id",
379
     * referencedColumnName="id") */
380
    private $two;
0 ignored issues
show
introduced by
The private property $two is not used, and could be removed.
Loading history...
381
}
382
383
/**
384
 * @ORM\Entity
385
 */
386
class DDC3274One
387
{
388
    /**
389
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
390
     */
391
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
392
393
    /**
394
     * @ORM\OneToMany(targetEntity=DDC3274Two::class, mappedBy="one")
395
     */
396
    private $two;
397
}
398
399
/**
400
 * @ORM\Entity
401
 */
402
class DDC3274Two
403
{
404
    /**
405
     * @ORM\Id
406
     * @ORM\ManyToOne(targetEntity=DDC3274One::class)
407
     */
408
    private $one;
0 ignored issues
show
introduced by
The private property $one is not used, and could be removed.
Loading history...
409
}
410
411
/**
412
 * @ORM\Entity
413
 */
414
class DDC3322ValidEntity1
415
{
416
    /**
417
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
418
     */
419
    private $id;
420
421
    /**
422
     * @ORM\ManyToOne(targetEntity=DDC3322One::class, inversedBy="validAssoc")
423
     */
424
    private $oneValid;
0 ignored issues
show
introduced by
The private property $oneValid is not used, and could be removed.
Loading history...
425
426
    /**
427
     * @ORM\ManyToOne(targetEntity=DDC3322One::class, inversedBy="invalidAssoc")
428
     */
429
    private $oneInvalid;
0 ignored issues
show
introduced by
The private property $oneInvalid is not used, and could be removed.
Loading history...
430
431
    /**
432
     * @ORM\ManyToOne(targetEntity=DDC3322Two::class, inversedBy="validAssoc")
433
     */
434
    private $twoValid;
0 ignored issues
show
introduced by
The private property $twoValid is not used, and could be removed.
Loading history...
435
436
    /**
437
     * @ORM\ManyToOne(targetEntity=DDC3322Two::class, inversedBy="invalidAssoc")
438
     */
439
    private $twoInvalid;
0 ignored issues
show
introduced by
The private property $twoInvalid is not used, and could be removed.
Loading history...
440
441
    /**
442
     * @ORM\ManyToOne(targetEntity=DDC3322Three::class, inversedBy="validAssoc")
443
     */
444
    private $threeValid;
0 ignored issues
show
introduced by
The private property $threeValid is not used, and could be removed.
Loading history...
445
446
    /**
447
     * @ORM\ManyToOne(targetEntity=DDC3322Three::class, inversedBy="invalidAssoc")
448
     */
449
    private $threeInvalid;
0 ignored issues
show
introduced by
The private property $threeInvalid is not used, and could be removed.
Loading history...
450
451
    /**
452
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity2::class, mappedBy="manyToOne")
453
     */
454
    private $oneToMany;
0 ignored issues
show
introduced by
The private property $oneToMany is not used, and could be removed.
Loading history...
455
456
    /**
457
     * @ORM\ManyToOne(targetEntity=DDC3322ValidEntity2::class, inversedBy="oneToMany")
458
     */
459
    private $manyToOne;
0 ignored issues
show
introduced by
The private property $manyToOne is not used, and could be removed.
Loading history...
460
461
    /**
462
     * @ORM\OneToOne(targetEntity=DDC3322ValidEntity2::class, mappedBy="oneToOneOwning")
463
     */
464
    private $oneToOneInverse;
0 ignored issues
show
introduced by
The private property $oneToOneInverse is not used, and could be removed.
Loading history...
465
466
    /**
467
     * @ORM\OneToOne(targetEntity=DDC3322ValidEntity2::class, inversedBy="oneToOneInverse")
468
     */
469
    private $oneToOneOwning;
0 ignored issues
show
introduced by
The private property $oneToOneOwning is not used, and could be removed.
Loading history...
470
}
471
472
/**
473
 * @ORM\Entity
474
 */
475
class DDC3322ValidEntity2
476
{
477
    /**
478
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
479
     */
480
    private $id;
481
482
    /**
483
     * @ORM\ManyToOne(targetEntity=DDC3322ValidEntity1::class, inversedBy="oneToMany")
484
     */
485
    private $manyToOne;
486
487
    /**
488
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="manyToOne")
489
     */
490
    private $oneToMany;
491
492
    /**
493
     * @ORM\OneToOne(targetEntity=DDC3322ValidEntity1::class, inversedBy="oneToOneInverse")
494
     */
495
    private $oneToOneOwning;
496
497
    /**
498
     * @ORM\OneToOne(targetEntity=DDC3322ValidEntity1::class, mappedBy="oneToOneOwning")
499
     */
500
    private $oneToOneInverse;
501
}
502
503
/**
504
 * @ORM\Entity
505
 */
506
class DDC3322One
507
{
508
    /**
509
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
510
     */
511
    private $id;
512
513
    /**
514
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="oneValid")
515
     * @ORM\OrderBy({"id" = "ASC"})
516
     */
517
    private $validAssoc;
0 ignored issues
show
introduced by
The private property $validAssoc is not used, and could be removed.
Loading history...
518
519
    /**
520
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="oneInvalid")
521
     * @ORM\OrderBy({"invalidField" = "ASC"})
522
     */
523
    private $invalidAssoc;
0 ignored issues
show
introduced by
The private property $invalidAssoc is not used, and could be removed.
Loading history...
524
}
525
526
/**
527
 * @ORM\Entity
528
 */
529
class DDC3322Two
530
{
531
    /**
532
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
533
     */
534
    private $id;
535
536
    /**
537
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="twoValid")
538
     * @ORM\OrderBy({"manyToOne" = "ASC"})
539
     */
540
    private $validAssoc;
541
542
    /**
543
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="twoInvalid")
544
     * @ORM\OrderBy({"oneToMany" = "ASC"})
545
     */
546
    private $invalidAssoc;
547
}
548
549
/**
550
 * @ORM\Entity
551
 */
552
class DDC3322Three
553
{
554
    /**
555
     * @ORM\Id @ORM\Column @ORM\GeneratedValue
556
     */
557
    private $id;
558
559
    /**
560
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="threeValid")
561
     * @ORM\OrderBy({"oneToOneOwning" = "ASC"})
562
     */
563
    private $validAssoc;
564
565
    /**
566
     * @ORM\OneToMany(targetEntity=DDC3322ValidEntity1::class, mappedBy="threeInvalid")
567
     * @ORM\OrderBy({"oneToOneInverse" = "ASC"})
568
     */
569
    private $invalidAssoc;
570
}
571