-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Doctrine2] support non-entity doctrine @id on the haveInRepository d…
…ebug message. (#5692) * #5685: support non-entity doctrine @id, e.g. Ramsey\Uuid\Uuid on the haveInRepository debug message. * missing line indention. * check for uuid type first * catch correct MappingException. * Revert "catch correct MappingException." This reverts commit d3d4daf3 * catch both of doctrines MappingExceptions, since they don't share a common base exception. Catching \Exception here would be too vague.
- Loading branch information
1 parent
da1ecef
commit 135d90f
Showing
3 changed files
with
78 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Ramsey\Uuid\Uuid; | ||
use Ramsey\Uuid\UuidInterface; | ||
|
||
/** | ||
* @ORM\Entity | ||
*/ | ||
class EntityWithUuid | ||
{ | ||
/** | ||
* @var UuidInterface | ||
* | ||
* @ORM\Id | ||
* @ORM\Column(type="uuid", unique=true) | ||
* @ORM\GeneratedValue(strategy="CUSTOM") | ||
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") | ||
*/ | ||
private $id; | ||
|
||
public function __construct() | ||
{ | ||
$this->id = Uuid::uuid4(); | ||
} | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
} |
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