src/Entity/PointsCatalog/CatalogSize.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity\PointsCatalog;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\SiteInterface;
  6. use App\Entity\MiniAbstractBase;
  7. use App\Entity\Traits\NameTrait;
  8. use App\Entity\Traits\PositionTrait;
  9. use App\Entity\Traits\PublishedTrait;
  10. use App\Entity\Traits\SiteTrait;
  11. use App\Repository\PointsCatalog\CatalogSizeRepository;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Gedmo\Mapping\Annotation as Gedmo;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. /**
  16.  * @ORM\Table(name="vulco_points_catalog_size", indexes={@ORM\Index(name="catalog_size_site_idx", columns={"site"})})
  17.  * @ORM\Entity(repositoryClass=CatalogSizeRepository::class)
  18.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  19.  * @SiteAware(siteFieldName="site")
  20.  */
  21. class CatalogSize extends AbstractBase implements SiteInterface
  22. {
  23.     use NameTrait;
  24.     use PositionTrait;
  25.     use PublishedTrait;
  26.     use SiteTrait;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      * @Assert\NotBlank()
  30.      */
  31.     private string $name;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      * @Assert\NotBlank()
  35.      */
  36.     private int $position;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\PointsCatalog\CatalogSizeGroup", inversedBy="sizes")
  39.      * @ORM\JoinColumn(name="group_id", referencedColumnName="id")
  40.      */
  41.     private CatalogSizeGroup $group;
  42.     public function getGroup(): CatalogSizeGroup
  43.     {
  44.         return $this->group;
  45.     }
  46.     public function setGroup(CatalogSizeGroup $group): self
  47.     {
  48.         $this->group $group;
  49.         return $this;
  50.     }
  51.     public function __toString(): string
  52.     {
  53.         return $this->name $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  54.     }
  55. }