예제 #1
0
파일: User.php 프로젝트: arodiss/15x4
 /** @param Lecture $lecture */
 public function unfavLecture(Lecture $lecture)
 {
     if ($this->favoriteLectures->contains($lecture)) {
         $this->favoriteLectures->removeElement($lecture);
         $this->favoriteLectureIds = array_unique(array_diff($this->favoriteLectureIds, [$lecture->getId()]));
     }
     if ($lecture->getUsersFavorited()->contains($this)) {
         $lecture->getUsersFavorited()->removeElement($this);
         $lecture->setFavsCount($lecture->getFavsCount() - 1);
     }
 }
예제 #2
0
 /**
  * Remove lecture
  *
  * @param \Lecture $lecture
  */
 public function removeLecture(\Lecture $lecture)
 {
     $this->lectures->removeElement($lecture);
 }