src/Entity/PageNews.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Entity\Traits\EntitySoftDeletableTrait;
  5. use App\Entity\Traits\EntityTimestampableTrait;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation\SoftDeleteable;
  8. use JMS\Serializer\Annotation\ExclusionPolicy;
  9. /**
  10.  * @ORM\Table(name="page_news")
  11.  * @ORM\Entity(repositoryClass="App\Repository\PageNewsRepository")
  12.  * @SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=false)
  13.  * @ExclusionPolicy("all")
  14.  */
  15. class PageNews extends BaseDomain
  16. {
  17.     use EntityTimestampableTrait;
  18.     use EntitySoftDeletableTrait;
  19.     /**
  20.      * @ORM\Id()
  21.      * @ORM\GeneratedValue()
  22.      * @ORM\Column(type="integer")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="News",  inversedBy="news")
  27.      */
  28.     private $news;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="Page",  inversedBy="icons")
  31.      */
  32.     private $page;
  33.     /**
  34.      * @ORM\Column(type="integer", nullable=true)
  35.      */
  36.     private $position;
  37.     public function __construct()
  38.     {
  39.         $this->position 1;
  40.     }
  41.     /**
  42.      * @return mixed
  43.      */
  44.     public function getId()
  45.     {
  46.         return $this->id;
  47.     }
  48.     /**
  49.      * @return mixed
  50.      */
  51.     public function getPage()
  52.     {
  53.         return $this->page;
  54.     }
  55.     /**
  56.      * @param mixed $page
  57.      */
  58.     public function setPage($page)
  59.     {
  60.         $this->page $page;
  61.     }
  62.     /**
  63.      * @return int
  64.      */
  65.     public function getPosition()
  66.     {
  67.         return $this->position;
  68.     }
  69.     /**
  70.      * @param int $position
  71.      */
  72.     public function setPosition($position)
  73.     {
  74.         $this->position $position;
  75.     }
  76.     /**
  77.      * @return mixed
  78.      */
  79.     public function getNews()
  80.     {
  81.         return $this->news;
  82.     }
  83.     /**
  84.      * @param mixed $news
  85.      */
  86.     public function setNews($news): void
  87.     {
  88.         $this->news $news;
  89.     }
  90. }