<?php
namespace App\Entity\PointsCatalog;
use App\Annotation\SiteAware;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\SiteInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PositionTrait;
use App\Entity\Traits\PublishedTrait;
use App\Entity\Traits\SiteTrait;
use App\Repository\PointsCatalog\CatalogSizeRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Table(name="vulco_points_catalog_size", indexes={@ORM\Index(name="catalog_size_site_idx", columns={"site"})})
* @ORM\Entity(repositoryClass=CatalogSizeRepository::class)
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
* @SiteAware(siteFieldName="site")
*/
class CatalogSize extends AbstractBase implements SiteInterface
{
use NameTrait;
use PositionTrait;
use PublishedTrait;
use SiteTrait;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
private string $name;
/**
* @ORM\Column(type="integer")
* @Assert\NotBlank()
*/
private int $position;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\PointsCatalog\CatalogSizeGroup", inversedBy="sizes")
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
*/
private CatalogSizeGroup $group;
public function getGroup(): CatalogSizeGroup
{
return $this->group;
}
public function setGroup(CatalogSizeGroup $group): self
{
$this->group = $group;
return $this;
}
public function __toString(): string
{
return $this->name ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}