-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Controls growing rate of the abstract test class
- Loading branch information
Showing
6 changed files
with
61 additions
and
51 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap; | ||
|
||
/** @Entity */ | ||
final class Cube extends Shape | ||
{ | ||
} |
43 changes: 43 additions & 0 deletions
43
tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Shape.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap; | ||
|
||
use Doctrine\ORM\Mapping\ClassMetadataInfo; | ||
|
||
/** | ||
* @Entity | ||
* @InheritanceType("SINGLE_TABLE") | ||
* @DiscriminatorMap({"cube" = cube::class}) | ||
* @DiscriminatorColumn(name="discr", length=32, type="string") | ||
*/ | ||
abstract class Shape | ||
{ | ||
/** @Id @Column(type="string") @GeneratedValue(strategy="AUTO") */ | ||
public $id; | ||
|
||
public static function loadMetadata(ClassMetadataInfo $metadata) | ||
{ | ||
$metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); | ||
$metadata->setDiscriminatorColumn([ | ||
'name' => 'discr', | ||
'type' => 'string', | ||
'length' => 32, | ||
]); | ||
$metadata->setDiscriminatorMap([ | ||
'cube' => cube::class, | ||
]); | ||
$metadata->mapField([ | ||
'fieldName' => 'id', | ||
'type' => 'string', | ||
'length' => NULL, | ||
'precision' => 0, | ||
'scale' => 0, | ||
'nullable' => false, | ||
'unique' => false, | ||
'id' => true, | ||
'columnName' => 'id', | ||
]); | ||
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../php/Doctrine.Tests.ORM.Mapping.Shape.php → ...s.CaseSensitiveDiscriminatorMap.Shape.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../Doctrine.Tests.ORM.Mapping.Shape.dcm.yml → ...seSensitiveDiscriminatorMap.Shape.dcm.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters