src/Entity/Content/SMI/SmiItem.php line 22

  1. <?php
  2. namespace App\Entity\Content\SMI;
  3. use App\Entity\Common\Owner;
  4. use App\Entity\Traits\ActiveTrait;
  5. use App\Entity\Traits\TrackerFields;
  6. use App\Entity\Traits\UserCreatedInterface;
  7. use App\Entity\Traits\UserUpdatedInterface;
  8. use App\Entity\Traits\WeightTrait;
  9. use App\Model\Common\HaveOwnerInterface;
  10. use App\Model\Common\OwnerInterface;
  11. use App\Model\Translation\TranslatableTrait;
  12. use App\Repository\Content\SmiItemRepository;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
  15. #[ORM\Table(name'smi_item')]
  16. #[ORM\Entity(repositoryClassSmiItemRepository::class)]
  17. #[ORM\Index(fields: ["deleted"'active''weight''publishAt'], name'idx_active')]
  18. #[ORM\HasLifecycleCallbacks]
  19. class SmiItem implements UserCreatedInterfaceUserUpdatedInterfaceHaveOwnerInterfaceTranslatableInterface
  20. {
  21.     public const SITE_PER_PAGE 10;
  22.     use TrackerFields;
  23.     use WeightTrait;
  24.     use TranslatableTrait;
  25.     use ActiveTrait;
  26.     #[ORM\Id]
  27.     #[ORM\GeneratedValue(strategy'AUTO')]
  28.     #[ORM\Column(type'integer')]
  29.     private ?int $id null;
  30.     #[ORM\Column(type'string'nullabletrue)]
  31.     private ?string $link null;
  32.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  33.     private ?\DateTimeImmutable $publishAt null;
  34.     #[ORM\Embedded(class: \App\Entity\Common\Owner::class)]
  35.     private ?Owner $owner null;
  36.     public function getOwner(): OwnerInterface
  37.     {
  38.         return $this->owner;
  39.     }
  40.     public function setOwner(?Owner $owner): void
  41.     {
  42.         $this->owner $owner;
  43.     }
  44.     /**
  45.      * @return int|null
  46.      */
  47.     public function getId(): ?int
  48.     {
  49.         return $this->id;
  50.     }
  51.     /**
  52.      * @param int|null $id
  53.      */
  54.     public function setId(?int $id): void
  55.     {
  56.         $this->id $id;
  57.     }
  58.     /**
  59.      * @return string|null
  60.      */
  61.     public function getLink(): ?string
  62.     {
  63.         return $this->link;
  64.     }
  65.     /**
  66.      * @param string|null $link
  67.      */
  68.     public function setLink(?string $link): void
  69.     {
  70.         $this->link $link;
  71.     }
  72.     /**
  73.      * @return \DateTimeImmutable|null
  74.      */
  75.     public function getPublishAt(): ?\DateTimeImmutable
  76.     {
  77.         return $this->publishAt;
  78.     }
  79.     /**
  80.      * @param \DateTimeImmutable|null $publishAt
  81.      */
  82.     public function setPublishAt(?\DateTimeImmutable $publishAt): void
  83.     {
  84.         $this->publishAt $publishAt;
  85.     }
  86. }