-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Another batch of mapping tests refactored
- Loading branch information
Showing
21 changed files
with
643 additions
and
772 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Gedmo\Tests\Mapping\Fixture; | ||
|
||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* Class Embedded | ||
* | ||
* @author Fabian Sabau <fabian.sabau@socialbit.de> | ||
* | ||
* @ORM\Embeddable | ||
*/ | ||
#[ORM\Embeddable] | ||
class Embedded | ||
{ | ||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(type="string") | ||
*/ | ||
#[ORM\Column(type: Types::STRING)] | ||
private $subtitle; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Gedmo\Tests\Mapping\Fixture; | ||
|
||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Gedmo\Loggable\Entity\LogEntry; | ||
use Gedmo\Mapping\Annotation as Gedmo; | ||
|
||
/** | ||
* @ORM\Entity | ||
* | ||
* @Gedmo\Loggable(logEntryClass="Gedmo\Loggable\Entity\LogEntry") | ||
*/ | ||
#[ORM\Entity] | ||
#[Gedmo\Loggable(logEntryClass: LogEntry::class)] | ||
class LoggableWithEmbedded | ||
{ | ||
/** | ||
* @var int | ||
* | ||
* @ORM\Id | ||
* @ORM\GeneratedValue | ||
* @ORM\Column(type="integer") | ||
*/ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column(type: Types::INTEGER)] | ||
private $id; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="title", type="string") | ||
* | ||
* @Gedmo\Versioned | ||
*/ | ||
#[ORM\Column(name: 'title', type: Types::STRING)] | ||
#[Gedmo\Versioned] | ||
private $title; | ||
|
||
/** | ||
* @var Embedded | ||
* | ||
* @ORM\Embedded(class="Gedmo\Tests\Mapping\Fixture\Embedded") | ||
* | ||
* @Gedmo\Versioned | ||
*/ | ||
#[ORM\Embedded(class: Embedded::class)] | ||
#[Gedmo\Versioned] | ||
private $embedded; | ||
} |
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,103 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Doctrine Behavioral Extensions package. | ||
* (c) Gediminas Morkevicius <gediminas.morkevicius@gmail.com> http://www.gediminasm.org | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Gedmo\Tests\Mapping\Fixture; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Gedmo\Mapping\Annotation as Gedmo; | ||
|
||
/** | ||
* @ORM\Entity | ||
* @ORM\Table(name="sortables") | ||
*/ | ||
#[ORM\Entity] | ||
#[ORM\Table(name: 'sortables')] | ||
class Sortable | ||
{ | ||
/** | ||
* @var int | ||
* | ||
* @ORM\Id | ||
* @ORM\GeneratedValue | ||
* @ORM\Column(type="integer") | ||
*/ | ||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column(type: Types::INTEGER)] | ||
private $id; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(type="string", length=128) | ||
*/ | ||
#[ORM\Column(type: Types::STRING, length: 128)] | ||
private $title; | ||
|
||
/** | ||
* @var int | ||
* | ||
* @ORM\Column(type="integer") | ||
* | ||
* @Gedmo\SortablePosition | ||
*/ | ||
#[ORM\Column(type: Types::INTEGER)] | ||
#[Gedmo\SortablePosition] | ||
private $position; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(type="string", length=128) | ||
* | ||
* @Gedmo\SortableGroup | ||
*/ | ||
#[ORM\Column(type: Types::STRING, length: 128)] | ||
#[Gedmo\SortableGroup] | ||
private $grouping; | ||
|
||
/** | ||
* @var SortableGroup | ||
* | ||
* @ORM\ManyToOne(targetEntity="Sluggable") | ||
* | ||
* @Gedmo\SortableGroup | ||
*/ | ||
#[ORM\ManyToOne(targetEntity: SortableGroup::class)] | ||
#[Gedmo\SortableGroup] | ||
private $sortable_group; | ||
|
||
/** | ||
* @var Collection<int, SortableGroup> | ||
* | ||
* @ORM\ManyToMany(targetEntity="SortableGroup") | ||
* @ORM\JoinTable(name="sortable_sortable_groups", | ||
* joinColumns={@ORM\JoinColumn(name="sortable_id")}, | ||
* inverseJoinColumns={@ORM\JoinColumn(name="group_id")} | ||
* ) | ||
* | ||
* @Gedmo\SortableGroup | ||
*/ | ||
#[ORM\ManyToMany(targetEntity: SortableGroup::class)] | ||
#[ORM\JoinTable(name: 'sortable_sortable_groups')] | ||
#[ORM\JoinColumn(name: 'sortable_id')] | ||
#[ORM\InverseJoinColumn(name: 'group_id')] | ||
#[Gedmo\SortableGroup] | ||
private Collection $sortable_groups; | ||
|
||
public function __construct() | ||
{ | ||
$this->sortable_groups = new ArrayCollection(); | ||
} | ||
} |
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
Oops, something went wrong.