Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
215 additions
and
27 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
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
89 changes: 89 additions & 0 deletions
89
tests/Fixtures/TestBundle/Entity/RamseyUuidBinaryDummy.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,89 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <dunglas@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity; | ||
|
||
use ApiPlatform\Core\Annotation\ApiFilter; | ||
use ApiPlatform\Core\Annotation\ApiResource; | ||
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; | ||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Ramsey\Uuid\Uuid; | ||
use Ramsey\Uuid\UuidInterface; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ApiResource | ||
* @ApiFilter(SearchFilter::class, properties={"id"="exact", "relateds"="exact"}) | ||
*/ | ||
class RamseyUuidBinaryDummy | ||
{ | ||
/** | ||
* @var UuidInterface | ||
* | ||
* @ORM\Id | ||
* @ORM\Column(type="uuid_binary", unique=true) | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var Collection<RamseyUuidBinaryDummy> | ||
* | ||
* @ORM\OneToMany(targetEntity="RamseyUuidBinaryDummy", mappedBy="relatedParent") | ||
*/ | ||
private $relateds; | ||
|
||
/** | ||
* @var ?RamseyUuidBinaryDummy | ||
* | ||
* @ORM\ManyToOne(targetEntity="RamseyUuidBinaryDummy", inversedBy="relateds") | ||
*/ | ||
private $relatedParent; | ||
|
||
public function __construct() | ||
{ | ||
$this->relateds = new ArrayCollection(); | ||
} | ||
|
||
public function getId(): UuidInterface | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId(string $uuid): void | ||
{ | ||
$this->id = Uuid::fromString($uuid); | ||
} | ||
|
||
public function getRelateds(): Collection | ||
{ | ||
return $this->relateds; | ||
} | ||
|
||
public function addRelated(self $dummy): void | ||
{ | ||
$this->relateds->add($dummy); | ||
$dummy->setRelatedParent($this); | ||
} | ||
|
||
public function getRelatedParent(): ?self | ||
{ | ||
return $this->relatedParent; | ||
} | ||
|
||
public function setRelatedParent(self $dummy): void | ||
{ | ||
$this->relatedParent = $dummy; | ||
} | ||
} |
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
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