<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use App\BackendBundle\Interfaces\ProfileInterface;use App\Entity\OfferEntry;use App\Entity\SchoolLocation;class SchoolProfile implements ProfileInterface { /** * @var int */ private $id; /** * @var uuid */ private $uuid; /** * @var string */ private $name; /** * @var string */ private $description; /** * @var string */ private $trainingInformation; /** * @var string */ private $url; /** * @var int */ private $clickCount = 0; /** * @var \App\Entity\School */ private $school; /** * @var \App\Entity\Communication */ private $communication; /** * @var int */ private $logoStyle; /** * @var \App\Entity\Media */ private $schoolProfilePicture; /** * @var \App\Entity\Media */ private $headerPicture; /** * @var \App\Entity\Gallery */ private $gallery; /** * @var \App\Entity\Gallery */ private $videos; /** * @var \App\Entity\Gallery */ private $documents; /** * @var \Doctrine\Common\Collections\Collection */ private $contacts; /** * @var \Doctrine\Common\Collections\Collection */ private $locations; /** * @var \Doctrine\Common\Collections\Collection */ private $jobs; /** * @var \Doctrine\Common\Collections\Collection */ private $schoolBenefits; /** * @var \Doctrine\Common\Collections\Collection */ private $searchTags; /** * @var bool */ private $isVisible = true; /** * @var \App\Entity\ProfileLink */ private $profileLink; /** * @var \Doctrine\Common\Collections\Collection */ private $offers; /** * @var \Doctrine\Common\Collections\Collection */ private $gameQuizzes; /** * @var \Doctrine\Common\Collections\Collection */ private $jobDailyRoutines; /** * @var string|null */ private $certificateInformation; /** * Constructor */ public function __construct() { $this->contacts = new ArrayCollection(); $this->gameQuizzes = new ArrayCollection(); $this->jobs = new ArrayCollection(); $this->locations = new ArrayCollection(); $this->offers = new ArrayCollection(); $this->schoolBenefits = new ArrayCollection(); $this->searchTags = new ArrayCollection(); $this->jobDailyRoutines = new ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set uuid * * @param uuid $uuid * * @return SchoolProfile */ public function setUuid($uuid) { $this->uuid = $uuid; return $this; } /** * Get uuid * * @return uuid */ public function getUuid() { return $this->uuid; } /** * Set name * * @param string $name * * @return SchoolProfile */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set description * * @param string $description * * @return SchoolProfile */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get description * * @return string */ public function getDescription() { return $this->description; } /** * Set trainingInformation * * @param string $trainingInformation * * @return SchoolProfile */ public function setTrainingInformation($trainingInformation) { $this->trainingInformation = $trainingInformation; return $this; } /** * Get trainingInformation * * @return string */ public function getTrainingInformation() { return $this->trainingInformation; } /** * Set url * * @param string $url * * @return SchoolProfile */ public function setUrl($url) { $this->url = $url; return $this; } /** * Get url * * @return string */ public function getUrl() { return $this->url; } /** * Set clickCount * * @param integer $clickCount * * @return SchoolProfile */ public function setClickCount($clickCount) { $this->clickCount = $clickCount; return $this; } /** * Get clickCount * * @return integer */ public function getClickCount() { return $this->clickCount; } /** * Set school * * @param \App\Entity\School $school * * @return SchoolProfile */ public function setSchool(\App\Entity\School $school = null) { $this->school = $school; return $this; } /** * Get school * * @return \App\Entity\School */ public function getSchool() { return $this->school; } /** * Set communication * * @param \App\Entity\Communication $communication * * @return SchoolProfile */ public function setCommunication(\App\Entity\Communication $communication = null) { $this->communication = $communication; return $this; } /** * Get communication * * @return \App\Entity\Communication */ public function getCommunication() { return $this->communication; } /** * Set gallery * * @param \App\Entity\Gallery $gallery * * @return SchoolProfile */ public function setGallery(\App\Entity\Gallery $gallery = null) { $this->gallery = $gallery; return $this; } /** * Get gallery * * @return \App\Entity\Gallery */ public function getGallery() { return $this->gallery; } /** * Set videos * * @param \App\Entity\Gallery $videos * * @return SchoolProfile */ public function setVideos(\App\Entity\Gallery $videos = null) { $this->videos = $videos; return $this; } /** * Get videos * * @return \App\Entity\Gallery */ public function getVideos() { return $this->videos; } /** * Set documents * * @param \App\Entity\Gallery $documents * * @return SchoolProfile */ public function setDocuments(\App\Entity\Gallery $documents = null) { $this->documents = $documents; return $this; } /** * Get documents * * @return \App\Entity\Gallery */ public function getDocuments() { return $this->documents; } /** * Add location * * @param \App\Entity\SchoolLocation $location * * @return SchoolProfile */ public function addLocation(\App\Entity\SchoolLocation $location) { $this->locations[] = $location; return $this; } /** * Remove location * * @param \App\Entity\SchoolLocation $location */ public function removeLocation(\App\Entity\SchoolLocation $location) { $this->locations->removeElement($location); } /** * Get locations * * @return \Doctrine\Common\Collections\Collection */ public function getLocations() { return $this->locations; } /** * Add job * * @param \App\Entity\Job $job * * @return SchoolProfile */ public function addJob(\App\Entity\Job $job) { $this->jobs[] = $job; return $this; } /** * Remove job * * @param \App\Entity\Job $job */ public function removeJob(\App\Entity\Job $job) { $this->jobs->removeElement($job); } /** * Get jobs * * @return \Doctrine\Common\Collections\Collection */ public function getJobs() { return $this->jobs; } /** * Add searchTag. * * @param \App\Entity\SearchTag $searchTag * * @return SchoolProfile */ public function addSearchTag(\App\Entity\SearchTag $searchTag) { $this->searchTags[] = $searchTag; return $this; } /** * Remove searchTag. * * @param \App\Entity\SearchTag $searchTag * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeSearchTag(\App\Entity\SearchTag $searchTag) { return $this->searchTags->removeElement($searchTag); } /** * Add schoolBenefit. * * @param \App\Entity\SchoolBenefit $schoolBenefit * * @return SchoolProfile */ public function addSchoolBenefit(\App\Entity\SchoolBenefit $schoolBenefit) { $this->schoolBenefits[] = $schoolBenefit; return $this; } /** * Remove schoolBenefit. * * @param \App\Entity\SchoolBenefit $schoolBenefit * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeSchoolBenefit(\App\Entity\SchoolBenefit $schoolBenefit) { return $this->schoolBenefits->removeElement($schoolBenefit); } /** * Get schoolBenefits. * * @return \Doctrine\Common\Collections\Collection */ public function getSchoolBenefits() { return $this->schoolBenefits; } /** * Get searchTags. * * @return \Doctrine\Common\Collections\Collection */ public function getSearchTags() { return $this->searchTags; } public function getLogoStyle() { return $this->logoStyle; } public function setLogoStyle($logoStyle) { $this->logoStyle = $logoStyle; } /** * Set schoolProfilePicture. * * @param \App\Entity\Media|null $schoolProfilePicture * * @return SchoolProfile */ public function setSchoolProfilePicture(\App\Entity\Media $schoolProfilePicture = null) { $this->schoolProfilePicture = $schoolProfilePicture; return $this; } /** * Get schoolProfilePicture. * * @return \App\Entity\Media|null */ public function getSchoolProfilePicture() { return $this->schoolProfilePicture; } /** * Set headerPicture * * @param \App\Entity\Media $headerPicture * * @return SchoolProfile */ public function setHeaderPicture(\App\Entity\Media $headerPicture = null) { $this->headerPicture = $headerPicture; return $this; } /** * Get headerPicture * * @return \App\Entity\Media */ public function getHeaderPicture() { return $this->headerPicture; } /** * Set certificateInformation. * * @param string|null $certificateInformation * * @return SchoolProfile */ public function setCertificateInformation($certificateInformation = null) { $this->certificateInformation = $certificateInformation; return $this; } /** * Get certificateInformation. * * @return string|null */ public function getCertificateInformation() { return $this->certificateInformation; } public function getSchoolTypes() { if ($this->school == null) { return array(); } return $this->school->getSchoolTypes(); } /* !!! must correspond to id in table profile_type !!! */ public function getProfileTypeID() { return 3; } public function hasAddressLatLon() { /* @var $location SchoolLocation */ foreach ($this->locations as $location) { if (!empty($location->getAddress()) && !empty($location->getAddress()->getAddressLatLon())) { return true; } } return false; } /** * Set isVisible. * * @param bool $isVisible * * @return SchoolProfile */ public function setIsVisible($isVisible) { $this->isVisible = $isVisible; return $this; } /** * Get isVisible. * * @return bool */ public function getIsVisible() { return $this->isVisible; } public function getIsComplete() { if (empty($this->schoolProfilePicture)) { return false; } if (strlen($this->description) < 100) { return false; } return true; } /** * @var \App\Entity\ContactGallery */ private $contactGallery; /** * Set contactGallery. * * @param \App\Entity\ContactGallery|null $contactGallery * * @return SchoolProfile */ public function setContactGallery(\App\Entity\ContactGallery $contactGallery = null) { $this->contactGallery = $contactGallery; return $this; } /** * Get contactGallery. * * @return \App\Entity\ContactGallery|null */ public function getContactGallery() { return $this->contactGallery; } public function getInterestFields() { if (empty($this->school)) { return array(); } return $this->school->getInterestFields(); } public function getProfileLink() { return $this->profileLink; } public function setProfileLink($profileLink) { $this->profileLink = $profileLink; } public function getGameQuizzes() { return $this->gameQuizzes; } public function setGameQuizzes($gameQuizzes) { $this->gameQuizzes = $gameQuizzes; } public function hasGameQuizzes() { if (count($this->gameQuizzes) > 0) { return true; } return false; } public function getJobDailyRoutines() { return $this->jobDailyRoutines; } public function setJobDailyRoutines($jobDailyRoutines) { $this->jobDailyRoutines = $jobDailyRoutines; } public function addJobDailyRoutine($jobDailyRoutine) { $this->jobDailyRoutines->add($jobDailyRoutine); } public function hasJobDailyRoutine() { if (count($this->jobDailyRoutines) > 0) { return true; } return false; } public function getOffers() { return $this->offers; } public function setOffers($offers) { $this->offers = $offers; } public function addOffer($offerEntry) { $this->offers[] = $offerEntry; } public function getOfferEntryByOfferID($offerID) { if (empty($this->offers)) { return null; } foreach ($this->offers as $offerEntry) { $entryOfferID = $offerEntry->getOffer()->getId(); if ($entryOfferID == $offerID) { return $offerEntry; } } return null; } public function hasOfferID($offerID) { foreach ($this->offers as $offerEntry) { $id = $offerEntry->getOffer()->getId(); if ($offerID == $id) { return true; } } return false; } public function countJobOffers() { return 0; } public function countJobs() { return count($this->jobs); }}