|
@@ -3,6 +3,8 @@
|
|
namespace AppBundle\Entity;
|
|
namespace AppBundle\Entity;
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* Film
|
|
* Film
|
|
@@ -66,6 +68,7 @@ class Film
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * @Assert\Valid()
|
|
* @ORM\OneToOne(targetEntity="AppBundle\Entity\MediaVideo", cascade={"persist","remove"})
|
|
* @ORM\OneToOne(targetEntity="AppBundle\Entity\MediaVideo", cascade={"persist","remove"})
|
|
* @ORM\JoinColumn(nullable=true)
|
|
* @ORM\JoinColumn(nullable=true)
|
|
*/
|
|
*/
|
|
@@ -106,9 +109,9 @@ class Film
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param mixed $mediaVideo
|
|
|
|
|
|
+ * @param \AppBundle\Entity\MediaVideo $mediaVideo
|
|
*/
|
|
*/
|
|
- public function setMediaVideo(\AppBundle\Entity\MediaVideo $mediaVideo = null)
|
|
|
|
|
|
+ public function setMediaVideo(MediaVideo $mediaVideo = null)
|
|
{
|
|
{
|
|
$this->mediaVideo = $mediaVideo;
|
|
$this->mediaVideo = $mediaVideo;
|
|
}
|
|
}
|
|
@@ -120,7 +123,7 @@ class Film
|
|
private $genres;
|
|
private $genres;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @return mixed
|
|
|
|
|
|
+ * @return \AppBundle\Entity\User $authered
|
|
*/
|
|
*/
|
|
public function getAuthered()
|
|
public function getAuthered()
|
|
{
|
|
{
|
|
@@ -128,9 +131,9 @@ class Film
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @param mixed $authered
|
|
|
|
|
|
+ * @param \AppBundle\Entity\User $authered
|
|
*/
|
|
*/
|
|
- public function setAuthered($authered)
|
|
|
|
|
|
+ public function setAuthered(User $authered)
|
|
{
|
|
{
|
|
$this->authered = $authered;
|
|
$this->authered = $authered;
|
|
$this->addUserWantToView($authered);
|
|
$this->addUserWantToView($authered);
|
|
@@ -229,7 +232,7 @@ class Film
|
|
*
|
|
*
|
|
* @return Film
|
|
* @return Film
|
|
*/
|
|
*/
|
|
- public function addRealisateur(\AppBundle\Entity\Realisateur $realisateur)
|
|
|
|
|
|
+ public function addRealisateur(Realisateur $realisateur)
|
|
{
|
|
{
|
|
$this->realisateurs[] = $realisateur;
|
|
$this->realisateurs[] = $realisateur;
|
|
|
|
|
|
@@ -241,7 +244,7 @@ class Film
|
|
*
|
|
*
|
|
* @param \AppBundle\Entity\Realisateur $realisateur
|
|
* @param \AppBundle\Entity\Realisateur $realisateur
|
|
*/
|
|
*/
|
|
- public function removeRealisateur(\AppBundle\Entity\Realisateur $realisateur)
|
|
|
|
|
|
+ public function removeRealisateur(Realisateur $realisateur)
|
|
{
|
|
{
|
|
$this->realisateurs->removeElement($realisateur);
|
|
$this->realisateurs->removeElement($realisateur);
|
|
}
|
|
}
|
|
@@ -264,7 +267,7 @@ class Film
|
|
*
|
|
*
|
|
* @return film
|
|
* @return film
|
|
*/
|
|
*/
|
|
- public function addUserWantToView(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function addUserWantToView(User $user)
|
|
{
|
|
{
|
|
$this->usersWantToView[] = $user;
|
|
$this->usersWantToView[] = $user;
|
|
$user->addFilm($this);
|
|
$user->addFilm($this);
|
|
@@ -277,7 +280,7 @@ class Film
|
|
*
|
|
*
|
|
* @param \AppBundle\Entity\User $user
|
|
* @param \AppBundle\Entity\User $user
|
|
*/
|
|
*/
|
|
- public function removeUserWantToView(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function removeUserWantToView(User $user)
|
|
{
|
|
{
|
|
$this->usersWantToView->removeElement($user);
|
|
$this->usersWantToView->removeElement($user);
|
|
$user->removeFilm($this);
|
|
$user->removeFilm($this);
|
|
@@ -297,7 +300,7 @@ class Film
|
|
* Inverse ToSee
|
|
* Inverse ToSee
|
|
* @param \AppBundle\Entity\User $user
|
|
* @param \AppBundle\Entity\User $user
|
|
*/
|
|
*/
|
|
- public function inverseUserWantToView(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function inverseUserWantToView(User $user)
|
|
{
|
|
{
|
|
if ($this->usersWantToView->contains($user)) {
|
|
if ($this->usersWantToView->contains($user)) {
|
|
$this->removeUserWantToView($user);
|
|
$this->removeUserWantToView($user);
|
|
@@ -315,7 +318,7 @@ class Film
|
|
*
|
|
*
|
|
* @return film
|
|
* @return film
|
|
*/
|
|
*/
|
|
- public function addUserWhoSeen(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function addUserWhoSeen(User $user)
|
|
{
|
|
{
|
|
$this->usersWhoSeen[] = $user;
|
|
$this->usersWhoSeen[] = $user;
|
|
$user->addFilmVu($this);
|
|
$user->addFilmVu($this);
|
|
@@ -328,7 +331,7 @@ class Film
|
|
*
|
|
*
|
|
* @param \AppBundle\Entity\User $user
|
|
* @param \AppBundle\Entity\User $user
|
|
*/
|
|
*/
|
|
- public function removeUserWhoSeen(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function removeUserWhoSeen(User $user)
|
|
{
|
|
{
|
|
$this->usersWhoSeen->removeElement($user);
|
|
$this->usersWhoSeen->removeElement($user);
|
|
$user->removeFilmVu($this);
|
|
$user->removeFilmVu($this);
|
|
@@ -348,7 +351,7 @@ class Film
|
|
* Inverse ToSee
|
|
* Inverse ToSee
|
|
* @param \AppBundle\Entity\User $user
|
|
* @param \AppBundle\Entity\User $user
|
|
*/
|
|
*/
|
|
- public function inverseUserWhoSeen(\AppBundle\Entity\User $user)
|
|
|
|
|
|
+ public function inverseUserWhoSeen(User $user)
|
|
{
|
|
{
|
|
if ($this->usersWhoSeen->contains($user)) {
|
|
if ($this->usersWhoSeen->contains($user)) {
|
|
$this->removeUserWhoSeen($user);
|
|
$this->removeUserWhoSeen($user);
|
|
@@ -374,7 +377,7 @@ class Film
|
|
*
|
|
*
|
|
* @return film
|
|
* @return film
|
|
*/
|
|
*/
|
|
- public function addGenre(\AppBundle\Entity\Genre $genre)
|
|
|
|
|
|
+ public function addGenre(Genre $genre)
|
|
{
|
|
{
|
|
$this->genres[] = $genre;
|
|
$this->genres[] = $genre;
|
|
return $this;
|
|
return $this;
|
|
@@ -386,7 +389,7 @@ class Film
|
|
* @param \AppBundle\Entity\Genre $genre
|
|
* @param \AppBundle\Entity\Genre $genre
|
|
* @return Film
|
|
* @return Film
|
|
*/
|
|
*/
|
|
- public function removeGenre(\AppBundle\Entity\Genre $genre)
|
|
|
|
|
|
+ public function removeGenre(Genre $genre)
|
|
{
|
|
{
|
|
$this->genres->removeElement($genre);
|
|
$this->genres->removeElement($genre);
|
|
return $this;
|
|
return $this;
|