-
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.
feat: allow STI child entities to have non-nullable relationships
- Loading branch information
Showing
5 changed files
with
75 additions
and
16 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
tests/Doctrine/Tests/Models/Company/CompanyCarContract.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,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\Company; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Doctrine\ORM\Mapping\Entity; | ||
|
||
/** @Entity */ | ||
class CompanyCarContract extends CompanyContract | ||
{ | ||
/** | ||
* @ORM\ManyToOne(targetEntity="CompanyCar") | ||
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE") | ||
* | ||
* @var CompanyCar | ||
*/ | ||
private $companyCar; | ||
|
||
public function calculatePrice(): int | ||
{ | ||
return 0; | ||
} | ||
|
||
public function setCompanyCar(CompanyCar $companyCar): void | ||
{ | ||
$this->companyCar = $companyCar; | ||
} | ||
} |
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
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