-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IDENTITY() type inference support
Supports IDENTITY(a.assoc) or IDENTITY(a.assoc, 'id_field') where 'id_field' is the name of one of the id fields of the target class. Does not support IDENTITY(a.assoc) when the target id field is also an association.
- Loading branch information
1 parent
46256c9
commit c49475b
Showing
5 changed files
with
166 additions
and
0 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
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
35 changes: 35 additions & 0 deletions
35
tests/Type/Doctrine/data/QueryResult/Entities/CompoundPk.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,35 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace QueryResult\Entities; | ||
|
||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Embedded as ORMEmbedded; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\JoinColumn; | ||
use Doctrine\ORM\Mapping\ManyToOne; | ||
use Doctrine\ORM\Mapping\OneToMany; | ||
use QueryResult\Entities\One; | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class CompoundPk | ||
{ | ||
/** | ||
* @Column(type="string") | ||
* @Id | ||
* | ||
* @var string | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @Column(type="integer") | ||
* @Id | ||
* | ||
* @var int | ||
*/ | ||
public $version; | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/Type/Doctrine/data/QueryResult/Entities/CompoundPkAssoc.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,36 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace QueryResult\Entities; | ||
|
||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Embedded as ORMEmbedded; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\JoinColumn; | ||
use Doctrine\ORM\Mapping\ManyToOne; | ||
use Doctrine\ORM\Mapping\OneToMany; | ||
use QueryResult\Entities\One; | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class CompoundPkAssoc | ||
{ | ||
/** | ||
* @ManyToOne(targetEntity="QueryResult\Entities\One") | ||
* @JoinColumn(nullable=false) | ||
* @Id | ||
* | ||
* @var One | ||
*/ | ||
public $one; | ||
|
||
/** | ||
* @Column(type="integer") | ||
* @Id | ||
* | ||
* @var int | ||
*/ | ||
public $version; | ||
} |
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