src/Entity/Edition.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Service\Edition\EditionProperties;
  4. use App\Service\MetaTags\MetaTagsProperties;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\EditionRepository")
  10.  */
  11. class Edition
  12. {
  13.     use MetaTagsProperties;
  14.     use EditionProperties;
  15.     /**
  16.      * @ORM\Id()
  17.      * @ORM\GeneratedValue()
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=512)
  23.      */
  24.     private $name;
  25.     /**
  26.      * @ORM\Column(type="string", length=32)
  27.      */
  28.     private $direction;
  29.     /**
  30.      * @ORM\Column(type="datetime")
  31.      */
  32.     private $date_end;
  33.     /**
  34.      * @ORM\Column(type="datetime")
  35.      */
  36.     private $date_publ;
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $cover;
  41.     /**
  42.      * @ORM\Column(type="string", length=32)
  43.      */
  44.     private $number;
  45.     /**
  46.      * @ORM\Column(type="string", length=2048, nullable=true)
  47.      */
  48.     private $link_elibrary;
  49.     /**
  50.      * @ORM\Column(type="integer")
  51.      */
  52.     private $created;
  53.     /**
  54.      * @ORM\Column(type="text", nullable=true)
  55.      */
  56.     private $body;
  57.     /**
  58.      * @ORM\Column(type="integer", nullable=true)
  59.      */
  60.     private $nid;
  61.     /**
  62.      * @ORM\OneToMany(targetEntity="App\Entity\EditionPages", mappedBy="entity", orphanRemoval=true, cascade={"persist", "remove"}, fetch="EAGER")
  63.      */
  64.     private $editionPages;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity="App\Entity\Articles", mappedBy="edition")
  67.      */
  68.     private $articles;
  69.     /**
  70.      * @ORM\Column(type="string", length=2048, nullable=true)
  71.      */
  72.     private $exit_data;
  73.     /**
  74.      * @ORM\Column(type="string", length=255, nullable=true)
  75.      */
  76.     private $link_rinc;
  77.     /**
  78.      * @ORM\Column(type="integer", nullable=true)
  79.      */
  80.     private $updated;
  81.     /**
  82.      * @ORM\Column(type="string", length=255, nullable=true)
  83.      */
  84.     private $file;
  85.     
  86.     //Даты выпуска
  87.     private $date;
  88.     /**
  89.      * @ORM\OneToOne(targetEntity=Path::class, cascade={"persist", "remove"}, fetch="EAGER")
  90.      * @ORM\JoinColumn(nullable=true)
  91.      */
  92.     private $path;
  93.     /**
  94.      * @ORM\Column(type="boolean")
  95.      */
  96.     private $EmailSubscribe;
  97.     /**
  98.      * @ORM\ManyToOne(targetEntity=User::class)
  99.      * @ORM\JoinColumn(nullable=false)
  100.      */
  101.     private $user;
  102.     /**
  103.      * @ORM\Column(type="boolean")
  104.      */
  105.     private $status;
  106.     /**
  107.      * @ORM\Column(type="boolean", nullable=true)
  108.      */
  109.     private $send_email_pdf;
  110.     /**
  111.      * @ORM\Column(type="datetime", nullable=true)
  112.      */
  113.     private $date_send_elibrary;
  114.     /**
  115.      * @ORM\Column(type="datetime", nullable=true)
  116.      */
  117.     private $date_send_date;
  118.     /**
  119.      * @ORM\Column(type="datetime", nullable=true)
  120.      */
  121.     private $date_send_postal;
  122.     /**
  123.      * @ORM\Column(type="text", nullable=true)
  124.      */
  125.     private $price;
  126.     public function getDate(): ?array
  127.     {
  128.         return $this->date;
  129.     }
  130.     public function setDate(array $date): self
  131.     {
  132.         $this->date $date;
  133.         return $this;
  134.     }
  135.     public function __construct()
  136.     {
  137.         $this->editionPages = new ArrayCollection();
  138.         $this->articles = new ArrayCollection();
  139.     }
  140.     public function __toString()
  141.     {
  142.         return $this->name.' ('.$this->date_end->format('d.m.Y').')';
  143.     }
  144.     public function getId(): ?int
  145.     {
  146.         return $this->id;
  147.     }
  148.     public function getName(): ?string
  149.     {
  150.         return $this->name;
  151.     }
  152.     public function setName(string $name): self
  153.     {
  154.         $this->name $name;
  155.         return $this;
  156.     }
  157.     public function getDirection(): ?string
  158.     {
  159.         return $this->direction;
  160.     }
  161.     public function setDirection(string $direction): self
  162.     {
  163.         $this->direction $direction;
  164.         return $this;
  165.     }
  166.     public function getDateEnd(): ?\DateTimeInterface
  167.     {
  168.         return $this->date_end;
  169.     }
  170.     public function setDateEnd(\DateTimeInterface $date_end): self
  171.     {
  172.         $this->date_end $date_end;
  173.         return $this;
  174.     }
  175.     public function getDatePubl(): ?\DateTimeInterface
  176.     {
  177.         return $this->date_publ;
  178.     }
  179.     public function setDatePubl(\DateTimeInterface $date_publ): self
  180.     {
  181.         $this->date_publ $date_publ;
  182.         return $this;
  183.     }
  184.     public function getCover(): ?string
  185.     {
  186.         return $this->cover;
  187.     }
  188.     public function setCover(string $cover): self
  189.     {
  190.         $this->cover $cover;
  191.         return $this;
  192.     }
  193.     public function getNumber(): ?string
  194.     {
  195.         return $this->number;
  196.     }
  197.     public function setNumber(string $number): self
  198.     {
  199.         $this->number $number;
  200.         return $this;
  201.     }
  202.     public function getLinkElibrary(): ?string
  203.     {
  204.         return $this->link_elibrary;
  205.     }
  206.     public function setLinkElibrary(?string $link_elibrary): self
  207.     {
  208.         $this->link_elibrary $link_elibrary;
  209.         return $this;
  210.     }
  211.     public function getCreated(): ?int
  212.     {
  213.         return $this->created;
  214.     }
  215.     public function setCreated(int $created): self
  216.     {
  217.         $this->created $created;
  218.         return $this;
  219.     }
  220.     public function getBody(): ?string
  221.     {
  222.         return $this->body;
  223.     }
  224.     public function setBody(?string $body): self
  225.     {
  226.         $this->body $body;
  227.         return $this;
  228.     }
  229.     public function getNid(): ?int
  230.     {
  231.         return $this->nid;
  232.     }
  233.     public function setNid(?int $nid): self
  234.     {
  235.         $this->nid $nid;
  236.         return $this;
  237.     }
  238.     /**
  239.      * @return Collection|EditionPages[]
  240.      */
  241.     public function getEditionPages(): Collection
  242.     {
  243.         return $this->editionPages;
  244.     }
  245.     public function addEditionPage(EditionPages $editionPage): self
  246.     {
  247.         if (!$this->editionPages->contains($editionPage)) {
  248.             $this->editionPages[] = $editionPage;
  249.             $editionPage->setEntity($this);
  250.         }
  251.         return $this;
  252.     }
  253.     public function removeEditionPage(EditionPages $editionPage): self
  254.     {
  255.         if ($this->editionPages->contains($editionPage)) {
  256.             $this->editionPages->removeElement($editionPage);
  257.             // set the owning side to null (unless already changed)
  258.             if ($editionPage->getEntity() === $this) {
  259.                 $editionPage->setEntity(null);
  260.             }
  261.         }
  262.         return $this;
  263.     }
  264.     /**
  265.      * @return Collection|Articles[]
  266.      */
  267.     public function getArticles(): Collection
  268.     {
  269.         return $this->articles;
  270.     }
  271.     public function addArticle(Articles $article): self
  272.     {
  273.         if (!$this->articles->contains($article)) {
  274.             $this->articles[] = $article;
  275.             $article->setEdition($this);
  276.         }
  277.         return $this;
  278.     }
  279.     public function removeArticle(Articles $article): self
  280.     {
  281.         if ($this->articles->contains($article)) {
  282.             $this->articles->removeElement($article);
  283.             // set the owning side to null (unless already changed)
  284.             if ($article->getEdition() === $this) {
  285.                 $article->setEdition(null);
  286.             }
  287.         }
  288.         return $this;
  289.     }
  290.     public function getExitData(): ?string
  291.     {
  292.         return $this->exit_data;
  293.     }
  294.     public function setExitData(?string $exit_data): self
  295.     {
  296.         $this->exit_data $exit_data;
  297.         return $this;
  298.     }
  299.     public function getLinkRinc(): ?string
  300.     {
  301.         return $this->link_rinc;
  302.     }
  303.     public function setLinkRinc(?string $link_rinc): self
  304.     {
  305.         $this->link_rinc $link_rinc;
  306.         return $this;
  307.     }
  308.     public function getUpdated(): ?int
  309.     {
  310.         return $this->updated;
  311.     }
  312.     public function setUpdated(?int $updated): self
  313.     {
  314.         $this->updated $updated;
  315.         return $this;
  316.     }
  317.     public function getFile(): ?string
  318.     {
  319.         return $this->file;
  320.     }
  321.     public function setFile(?string $file): self
  322.     {
  323.         $this->file $file;
  324.         return $this;
  325.     }
  326.     public function getPath(): ?Path
  327.     {
  328.         return $this->path;
  329.     }
  330.     public function setPath(?Path $path): self
  331.     {
  332.         $this->path $path;
  333.         return $this;
  334.     }
  335.     public function getEmailSubscribe(): ?bool
  336.     {
  337.         return $this->EmailSubscribe;
  338.     }
  339.     public function setEmailSubscribe(bool $EmailSubscribe): self
  340.     {
  341.         $this->EmailSubscribe $EmailSubscribe;
  342.         return $this;
  343.     }
  344.     public function getUser(): ?User
  345.     {
  346.         return $this->user;
  347.     }
  348.     public function setUser(?User $user): self
  349.     {
  350.         $this->user $user;
  351.         return $this;
  352.     }
  353.     public function getStatus(): ?bool
  354.     {
  355.         return $this->status;
  356.     }
  357.     public function setStatus(bool $status): self
  358.     {
  359.         $this->status $status;
  360.         return $this;
  361.     }
  362.     public function isSendEmailPdf(): ?bool
  363.     {
  364.         return $this->send_email_pdf;
  365.     }
  366.     public function setSendEmailPdf(?bool $send_email_pdf): self
  367.     {
  368.         $this->send_email_pdf $send_email_pdf;
  369.         return $this;
  370.     }
  371.     public function getDateSendElibrary(): ?\DateTimeInterface
  372.     {
  373.         return $this->date_send_elibrary;
  374.     }
  375.     public function setDateSendElibrary(?\DateTimeInterface $date_send_elibrary): self
  376.     {
  377.         $this->date_send_elibrary $date_send_elibrary;
  378.         return $this;
  379.     }
  380.     public function getDateSendDate(): ?\DateTimeInterface
  381.     {
  382.         return $this->date_send_date;
  383.     }
  384.     public function setDateSendDate(?\DateTimeInterface $date_send_date): self
  385.     {
  386.         $this->date_send_date $date_send_date;
  387.         return $this;
  388.     }
  389.     public function getDateSendPostal(): ?\DateTimeInterface
  390.     {
  391.         return $this->date_send_postal;
  392.     }
  393.     public function setDateSendPostal(?\DateTimeInterface $date_send_postal): self
  394.     {
  395.         $this->date_send_postal $date_send_postal;
  396.         return $this;
  397.     }
  398.     public function getPrice(): ?array
  399.     {
  400.         return $this->price?unserialize($this->price):null;
  401.     }
  402.     public function setPrice(?string $price): self
  403.     {
  404.         $this->price $price;
  405.         return $this;
  406.     }
  407. }