-
Notifications
You must be signed in to change notification settings - Fork 0
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
roadiz-ci
committed
Mar 8, 2024
1 parent
937d8b6
commit 6741835
Showing
4 changed files
with
45 additions
and
6 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,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace RZ\Roadiz\CoreBundle\Entity; | ||
|
||
use ApiPlatform\Doctrine\Orm\Filter\NumericFilter; | ||
use ApiPlatform\Doctrine\Orm\Filter\RangeFilter; | ||
use ApiPlatform\Metadata\ApiFilter; | ||
use Doctrine\Common\Comparable; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use JMS\Serializer\Annotation as Serializer; | ||
use RZ\Roadiz\Core\AbstractEntities\AbstractDateTimed; | ||
use RZ\Roadiz\Core\AbstractEntities\PositionedInterface; | ||
use RZ\Roadiz\Core\AbstractEntities\PositionedTrait; | ||
use Symfony\Component\Serializer\Annotation as SymfonySerializer; | ||
|
||
/** | ||
* Combined AbstractDateTimed and PositionedTrait. | ||
*/ | ||
#[ | ||
ORM\MappedSuperclass, | ||
ORM\HasLifecycleCallbacks, | ||
ORM\Table, | ||
ORM\Index(columns: ["position"]), | ||
ORM\Index(columns: ["created_at"]), | ||
ORM\Index(columns: ["updated_at"]) | ||
] | ||
abstract class AbstractDateTimedPositioned extends AbstractDateTimed implements PositionedInterface, Comparable | ||
{ | ||
use PositionedTrait; | ||
|
||
#[ | ||
ORM\Column(type: "float"), | ||
Serializer\Groups(["position"]), | ||
Serializer\Type("float"), | ||
SymfonySerializer\Groups(["position"]), | ||
ApiFilter(RangeFilter::class), | ||
ApiFilter(NumericFilter::class) | ||
] | ||
protected float $position = 0.0; | ||
} |
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