src/Entity/Article.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use Symfony\Component\HttpFoundation\File\UploadedFile;
  12. use Symfony\Component\HttpFoundation\File\File;
  13. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. /**
  15.  * @ORM\Entity
  16.  * @ORM\Table(name="article")
  17.  */
  18. class Article implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  19.     use BlameableTrait;
  20.     use TimestampableTrait;
  21.     
  22.     use SoftDeletableTrait;
  23.     
  24. static public function getShoppingArticleId($locale) {
  25.         if ($locale == 'ro') {
  26.             return 28;
  27.         }
  28.         if ($locale == 'sk') {
  29.             return 14;
  30.         }
  31.         if ($locale == 'cz') {
  32.             return 6;
  33.         }
  34.         return 2;
  35.     }
  36.     /**
  37.      * @ORM\Id
  38.      * @ORM\Column(type="integer")
  39.      * @ORM\GeneratedValue(strategy="AUTO")
  40.      */
  41.     protected $id;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  46.      */
  47.     private $title;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  50.      * @ORM\JoinColumn(name="language_id", referencedColumnName="id")
  51.      */
  52.     protected $language;
  53.     /**
  54.      * @var string
  55.      *
  56.      * @ORM\Column(name="content", type="text", nullable=true)
  57.      */
  58.     private $content;
  59.     /**
  60.      * @var string
  61.      *
  62.      * @ORM\Column(name="slug", type="text", nullable=true)
  63.      */
  64.     private $slug;
  65.     /**
  66.      * @Doctrine\ORM\Mapping\Column(type="boolean", nullable=true)
  67.      */
  68.     protected $header true;
  69.     /**
  70.      * @Doctrine\ORM\Mapping\Column(type="boolean", nullable=true)
  71.      */
  72.     protected $footer true;
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getTitle(): ?string
  78.     {
  79.         return $this->title;
  80.     }
  81.     public function setTitle(?string $title): self
  82.     {
  83.         $this->title $title;
  84.         return $this;
  85.     }
  86.     public function getContent(): ?string
  87.     {
  88.         return $this->content;
  89.     }
  90.     public function setContent(?string $content): self
  91.     {
  92.         $this->content $content;
  93.         return $this;
  94.     }
  95.     public function getSlug(): ?string
  96.     {
  97.         return $this->slug;
  98.     }
  99.     public function setSlug(?string $slug): self
  100.     {
  101.         $this->slug $slug;
  102.         return $this;
  103.     }
  104.     public function getHeader(): ?bool
  105.     {
  106.         return $this->header;
  107.     }
  108.     public function setHeader(?bool $header): self
  109.     {
  110.         $this->header $header;
  111.         return $this;
  112.     }
  113.     public function getFooter(): ?bool
  114.     {
  115.         return $this->footer;
  116.     }
  117.     public function setFooter(?bool $footer): self
  118.     {
  119.         $this->footer $footer;
  120.         return $this;
  121.     }
  122.     public function getLanguage(): ?Language
  123.     {
  124.         return $this->language;
  125.     }
  126.     public function setLanguage(?Language $language): self
  127.     {
  128.         $this->language $language;
  129.         return $this;
  130.     }
  131. }