to_record; } /** * @param bool $to_record */ public function setToRecord($to_record) { $this->to_record = $to_record; } /** * @return boolean */ public function getToRecord() { return $this->to_record; } public function __construct() { parent::__construct(); $this->materials = new ArrayCollection(); $this->speakers = new ArrayCollection(); $this->to_record = false; } /** * @return string */ public function getLevel() { return $this->level; } /** * @param string $level */ public function setLevel($level) { $this->level = $level; } /** * @return string */ public function getProblemAddressed() { return $this->problem_addressed; } /** * @param string $problem_addressed */ public function setProblemAddressed($problem_addressed) { $this->problem_addressed = $problem_addressed; } /** * @return string */ public function getAttendeesExpectedLearnt() { return $this->attendees_expected_learnt; } /** * @param string $attendees_expected_learnt */ public function setAttendeesExpectedLearnt($attendees_expected_learnt) { $this->attendees_expected_learnt = $attendees_expected_learnt; } /** * @return string */ public function getClassName(){ return self::ClassNamePresentation; } /** * @return PresentationSpeaker[] */ public function getSpeakers() { return $this->speakers; } /** * @param PresentationSpeaker $speaker */ public function addSpeaker(PresentationSpeaker $speaker){ $this->speakers->add($speaker); $speaker->addPresentation($this); } public function clearSpeakers(){ $this->speakers->clear(); } /** * @return int[] */ public function getSpeakerIds() { return $this->speakers->map(function($entity) { return $entity->getId(); })->toArray(); } /** * @return PresentationVideo[] */ public function getVideos() { return $this->materials->filter(function( $element) { return $element instanceof PresentationVideo; }); } /** * @param int $material_id * @return PresentationMaterial|null */ public function getMaterial($material_id){ $criteria = Criteria::create(); $criteria->where(Criteria::expr()->eq('id', intval($material_id))); $material = $this->materials->matching($criteria)->first(); return $material === false ? null:$material; } /** * @param PresentationVideo $video * @return $this */ public function addVideo(PresentationVideo $video){ $this->materials->add($video); $video->setPresentation($this); } /** * @return bool */ public function hasVideos(){ return count($this->getVideos()) > 0; } /** * @param int $video_id * @return PresentationVideo */ public function getVideoBy($video_id){ return $this->materials ->filter(function( $element) use($video_id) { return $element instanceof PresentationVideo && $element->getId() == $video_id; }) ->first(); } /** * @param PresentationVideo $video */ public function removeVideo(PresentationVideo $video){ $this->materials->removeElement($video); $video->unsetPresentation(); } /** * @return PresentationSlide[] */ public function getSlides() { return $this->materials->filter(function( $element) { return $element instanceof PresentationSlide; }); } /** * @param PresentationSlide $slide * @return $this */ public function addSlide(PresentationSlide $slide){ $this->materials->add($slide); $slide->setPresentation($this); } /** * @return bool */ public function hasSlides(){ return count($this->getSlides()) > 0; } /** * @return PresentationLink[] */ public function getLinks(){ return $this->materials->filter(function($element) { return $element instanceof PresentationLink; }); } /** * @return bool */ public function hasLinks(){ return count($this->getLinks()) > 0; } /** * @param PresentationLink $link * @return $this */ public function addLink(PresentationLink $link){ $this->materials->add($link); $link->setPresentation($this); } /** * @return int */ public function getModeratorId(){ try { return !is_null($this->moderator)? $this->moderator->getId():0; } catch(\Exception $ex){ return 0; } } /** * @return PresentationSpeaker */ public function getModerator() { return $this->moderator; } /** * @param PresentationSpeaker $moderator */ public function setModerator(PresentationSpeaker $moderator) { $this->moderator = $moderator; } public function unsetModerator(){ $this->moderator = null; } /** * @return string */ public function getStatus() { return $this->status; } /** * @param string $status */ public function setStatus($status) { $this->status = $status; } /** * @return mixed */ public function getProgress() { return $this->progress; } /** * @param mixed $progress */ public function setProgress($progress) { $this->progress = $progress; } /** * @return PresentationMaterial[] */ public function getMaterials() { return $this->materials; } /** * @param PresentationMaterial[] $materials */ public function setMaterials($materials) { $this->materials = $materials; } /** * @return SummitSelectedPresentation[] */ public function getSelectedPresentations() { return $this->selected_presentations; } /** * @param SummitSelectedPresentation[] $selected_presentations */ public function setSelectedPresentations($selected_presentations) { $this->selected_presentations = $selected_presentations; } }