src/Entity/Common/Link.php line 16

  1. <?php
  2. namespace App\Entity\Common;
  3. use App\Entity\Traits\TrackerFields;
  4. use App\Entity\Traits\UserCreatedInterface;
  5. use App\Entity\Traits\UserUpdatedInterface;
  6. use App\Model\Common\HaveOwnerInterface;
  7. use App\Model\Common\OwnerInterface;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Table(name'links')]
  10. #[ORM\Index(name'idx_relation'columns: ['owner_uuid''deleted'])]
  11. #[ORM\Entity(repositoryClass'App\Repository\Common\LinkRepository')]
  12. #[ORM\HasLifecycleCallbacks]
  13. class Link implements UserCreatedInterfaceUserUpdatedInterfaceHaveOwnerInterface
  14. {
  15.     use TrackerFields;
  16.     /**
  17.      * @var int|null
  18.      */
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue(strategy'AUTO')]
  21.     #[ORM\Column(type'integer')]
  22.     private $id;
  23.     /**
  24.      * @var string|null
  25.      */
  26.     #[ORM\Column(type'string')]
  27.     private $caption;
  28.     /**
  29.      * @var string|null
  30.      */
  31.     #[ORM\Column(type'string')]
  32.     private $url;
  33.     /**
  34.      * @var Owner
  35.      */
  36.     #[ORM\Embedded(class: 'App\Entity\Common\Owner')]
  37.     private $owner;
  38.     public function __construct()
  39.     {
  40.         $this->owner = new Owner();
  41.     }
  42.     /**
  43.      * @return int|null
  44.      */
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     /**
  50.      * @param int|null $id
  51.      */
  52.     public function setId(?int $id): void
  53.     {
  54.         $this->id $id;
  55.     }
  56.     /**
  57.      * @return string|null
  58.      */
  59.     public function getCaption(): ?string
  60.     {
  61.         return $this->caption;
  62.     }
  63.     /**
  64.      * @param string|null $caption
  65.      */
  66.     public function setCaption(?string $caption): void
  67.     {
  68.         $this->caption $caption;
  69.     }
  70.     /**
  71.      * @return string|null
  72.      */
  73.     public function getUrl(): ?string
  74.     {
  75.         return $this->url;
  76.     }
  77.     /**
  78.      * @param string|null $url
  79.      */
  80.     public function setUrl(?string $url): void
  81.     {
  82.         $this->url $url;
  83.     }
  84.     /**
  85.      * @return Owner
  86.      */
  87.     public function getOwner(): OwnerInterface
  88.     {
  89.         return $this->owner;
  90.     }
  91.     /**
  92.      * @param Owner $owner
  93.      */
  94.     public function setOwner(Owner $owner): void
  95.     {
  96.         $this->owner $owner;
  97.     }
  98. }