src/Entity/Tires/TireBrand.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Tires;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\Interfaces\PublishedInterface;
  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\Tires\TireBrandRepository;
  12. use Doctrine\ORM\Mapping as ORM;
  13. /**
  14.  * @ORM\Table(name="vulco_tire_brand", indexes={@ORM\Index(name="tire_brand_site_idx", columns={"site"})}, uniqueConstraints={@ORM\UniqueConstraint(name="tire_brand_unique_idx", columns={"name", "site"})})
  15.  * @ORM\Entity(repositoryClass=TireBrandRepository::class)
  16.  * @SiteAware(siteFieldName="site")
  17.  */
  18. class TireBrand implements SiteInterfacePublishedInterface
  19. {
  20.     use NameTrait;
  21.     use PositionTrait;
  22.     use PublishedTrait;
  23.     use SiteTrait;
  24.     /**
  25.      * @ORM\Column(name="id", type="integer")
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="AUTO")
  28.      */
  29.     private int $id;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=false)
  32.      */
  33.     private string $name;
  34.     /**
  35.      * @ORM\Column(type="integer", nullable=false, options={"default": 10})
  36.      */
  37.     private int $position 10;
  38.     public function __construct()
  39.     {
  40.     }
  41.     public function getId(): int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function setId(int $id): self
  46.     {
  47.         $this->id $id;
  48.         return $this;
  49.     }
  50.     public function __toString(): string
  51.     {
  52.         return $this->id $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  53.     }
  54. }