Browse Source

Date d'ajout de film

François 6 years ago
parent
commit
fcc48a07c2
1 changed files with 24 additions and 0 deletions
  1. 24 0
      src/AppBundle/Entity/Film.php

+ 24 - 0
src/AppBundle/Entity/Film.php

@@ -35,6 +35,29 @@ class Film
      */
     private $annee;
 
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="date_submited", type="datetime", nullable=true)
+     */
+    private $dateSubmited;
+
+    /**
+     * @return \DateTime
+     */
+    public function getDateSubmited()
+    {
+        return $this->dateSubmited;
+    }
+
+    /**
+     * @param \DateTime $dateSubmited
+     */
+    public function setDateSubmited(\DateTime $dateSubmited)
+    {
+        $this->dateSubmited = $dateSubmited;
+    }
+
     /**
      * @ORM\ManyToMany(targetEntity="AppBundle\Entity\Realisateur", inversedBy="films", cascade="persist")
      * @var \Doctrine\Common\Collections\Collection
@@ -151,6 +174,7 @@ class Film
         $this->usersWantToView = new \Doctrine\Common\Collections\ArrayCollection();
         $this->usersWhoSeen = new \Doctrine\Common\Collections\ArrayCollection();
         $this->genres = new \Doctrine\Common\Collections\ArrayCollection();
+        $this->setDateSubmited(new \DateTime());
     }
 
     /**