|
@@ -51,6 +51,12 @@ class User implements UserInterface
|
|
|
private $roles = array();
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="AppBundle\Entity\Film", mappedBy="user")
|
|
|
+ * @var \Doctrine\Common\Collections\Collection
|
|
|
+ */
|
|
|
+ private $films;
|
|
|
+
|
|
|
/**
|
|
|
* Get id
|
|
|
*
|
|
@@ -161,5 +167,45 @@ class User implements UserInterface
|
|
|
{
|
|
|
|
|
|
}
|
|
|
-}
|
|
|
+ /**
|
|
|
+ * Constructor
|
|
|
+ */
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ $this->films = new \Doctrine\Common\Collections\ArrayCollection();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Add film
|
|
|
+ *
|
|
|
+ * @param \AppBundle\Entity\Film $film
|
|
|
+ *
|
|
|
+ * @return User
|
|
|
+ */
|
|
|
+ public function addFilm(\AppBundle\Entity\Film $film)
|
|
|
+ {
|
|
|
+ $this->films[] = $film;
|
|
|
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Remove film
|
|
|
+ *
|
|
|
+ * @param \AppBundle\Entity\Film $film
|
|
|
+ */
|
|
|
+ public function removeFilm(\AppBundle\Entity\Film $film)
|
|
|
+ {
|
|
|
+ $this->films->removeElement($film);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get films
|
|
|
+ *
|
|
|
+ * @return \Doctrine\Common\Collections\Collection
|
|
|
+ */
|
|
|
+ public function getFilms()
|
|
|
+ {
|
|
|
+ return $this->films;
|
|
|
+ }
|
|
|
+}
|