<?phpnamespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use App\BackendBundle\Interfaces\ProfileInterface;use App\Entity\CompanyLocation;class CompanyProfile implements ProfileInterface { /** * @var int */ private $id; /** * @var uuid */ private $uuid; /** * @var \App\Entity\User */ private $user; /** * @var string */ private $name; /** * @var boolean */ private $isFlexiProfile = false; /** * @var string */ private $description; /** * @var string */ private $trainingInformation; /** * @var string */ private $url; /** * @var int */ private $founded; /** * @var int */ private $noOfTrainees; /** * @var int */ private $clickCount = 0; /** * @var \App\Entity\Communication */ private $communication; /** * @var int */ private $logoStyle; /** * @var \App\Entity\Media */ private $companyProfilePicture; /** * @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 \App\Entity\CompanySize */ private $companySize; /** * @var \Doctrine\Common\Collections\Collection */ private $certificates; /** * @var \Doctrine\Common\Collections\Collection */ private $jobs; /** * @var \Doctrine\Common\Collections\Collection */ private $sectors; /** * @var \Doctrine\Common\Collections\Collection */ private $searchTags; /** * @var \Doctrine\Common\Collections\Collection */ private $companyBenefits; /** * @var string|null */ private $certificateInformation; /** * @var string|null */ private $wknr; /** * @var \Doctrine\Common\Collections\Collection */ private $companyProfileMappings; /** * @var \Doctrine\Common\Collections\Collection */ private $jobOffers; /** * @var bool */ private $isVisible = true; /** * @var \Doctrine\Common\Collections\Collection */ private $interestFields; /** * @var \App\Entity\ProfileLink */ private $profileLink; /** * @var \Doctrine\Common\Collections\Collection */ private $offers; /** * @var \Doctrine\Common\Collections\Collection */ private $gameQuizzes; /** * Constructor */ public function __construct() { $this->certificates = new ArrayCollection(); $this->companyBenefits = new ArrayCollection(); $this->companyProfileMappings = new ArrayCollection(); $this->jobOffers = new ArrayCollection(); $this->contacts = new ArrayCollection(); $this->gameQuizzes = new ArrayCollection(); $this->interestFields = new ArrayCollection(); $this->jobs = new ArrayCollection(); $this->locations = new ArrayCollection(); $this->offers = new ArrayCollection(); $this->sectors = new ArrayCollection(); $this->searchTags = new ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set uuid * * @param uuid $uuid * * @return CompanyProfile */ 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 CompanyProfile */ public function setName($name) { $this->name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Set isFlexiProfile * * @param boolean $isFlexiProfile * * @return CompanyProfile */ public function setIsFlexiProfile($isFlexiProfile) { $this->isFlexiProfile = $isFlexiProfile; return $this; } /** * Get isFlexiProfile * * @return boolean */ public function getIsFlexiProfile() { return $this->isFlexiProfile; } /** * Set description * * @param string $description * * @return CompanyProfile */ 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 CompanyProfile */ public function setTrainingInformation($trainingInformation) { $this->trainingInformation = $trainingInformation; return $this; } /** * Get trainingInformation * * @return string */ public function getTrainingInformation() { return $this->trainingInformation; } /** * Set companyBenefits * * @param array $companyBenefits * * @return CompanyProfile */ public function setCompanyBenefits($companyBenefits) { $this->companyBenefits = $companyBenefits; return $this; } /** * Set url * * @param string $url * * @return CompanyProfile */ public function setUrl($url) { $this->url = $url; return $this; } /** * Get url * * @return string */ public function getUrl() { return $this->url; } /** * Set founded * * @param integer $founded * * @return CompanyProfile */ public function setFounded($founded) { $this->founded = $founded; return $this; } /** * Get founded * * @return integer */ public function getFounded() { return $this->founded; } /** * Set noOfTrainees * * @param integer $noOfTrainees * * @return CompanyProfile */ public function setNoOfTrainees($noOfTrainees) { $this->noOfTrainees = $noOfTrainees; return $this; } /** * Get noOfTrainees * * @return integer */ public function getNoOfTrainees() { return $this->noOfTrainees; } /** * Set clickCount * * @param integer $clickCount * * @return CompanyProfile */ public function setClickCount($clickCount) { $this->clickCount = $clickCount; return $this; } /** * Get clickCount * * @return integer */ public function getClickCount() { return $this->clickCount; } /** * Set communication * * @param \App\Entity\Communication $communication * * @return CompanyProfile */ 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; } public function getLogoStyle() { return $this->logoStyle; } public function setLogoStyle($logoStyle) { $this->logoStyle = $logoStyle; } /** * Set companyProfilePicture * * @param \App\Entity\Media $companyProfilePicture * * @return CompanyProfile */ public function setCompanyProfilePicture(\App\Entity\Media $companyProfilePicture = null) { $this->companyProfilePicture = $companyProfilePicture; return $this; } /** * Get companyProfilePicture * * @return \App\Entity\Media */ public function getCompanyProfilePicture() { return $this->companyProfilePicture; } /** * Set headerPicture * * @param \App\Entity\Media $headerPicture * * @return CompanyProfile */ 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 gallery * * @param \App\Entity\Gallery $gallery * * @return CompanyProfile */ 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 CompanyProfile */ 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 CompanyProfile */ 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\CompanyLocation $location * * @return CompanyProfile */ public function addLocation(\App\Entity\CompanyLocation $location) { $this->locations[] = $location; return $this; } /** * Remove location * * @param \App\Entity\CompanyLocation $location */ public function removeLocation(\App\Entity\CompanyLocation $location) { $this->locations->removeElement($location); } /** * Get locations * * @return \Doctrine\Common\Collections\Collection */ public function getLocations() { return $this->locations; } /** * Set companySize * * @param \App\Entity\CompanySize $companySize * * @return CompanyProfile */ public function setCompanySize(\App\Entity\CompanySize $companySize = null) { $this->companySize = $companySize; return $this; } /** * Get companySize * * @return \App\Entity\CompanySize */ public function getCompanySize() { return $this->companySize; } /** * Add certificate * * @param \App\Entity\CompanyCertificate $certificate * * @return CompanyProfile */ public function addCertificate(\App\Entity\CompanyCertificate $certificate) { $this->certificates[] = $certificate; return $this; } /** * Remove certificate * * @param \App\Entity\CompanyCertificate $certificate */ public function removeCertificate(\App\Entity\CompanyCertificate $certificate) { $this->certificates->removeElement($certificate); } /** * Get certificates * * @return \Doctrine\Common\Collections\Collection */ public function getCertificates() { return $this->certificates; } /** * Add job * * @param \App\Entity\Job $job * * @return CompanyProfile */ 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 sector * * @param \App\Entity\JobSector $sector * * @return CompanyProfile */ public function addSector(\App\Entity\JobSector $sector) { $this->sectors[] = $sector; return $this; } /** * Remove sector * * @param \App\Entity\JobSector $sector */ public function removeSector(\App\Entity\JobSector $sector) { $this->sectors->removeElement($sector); } /** * Get sectors * * @return \Doctrine\Common\Collections\Collection */ public function getSectors() { return $this->sectors; } /** * Add searchTag. * * @param \App\Entity\SearchTag $searchTag * * @return CompanyProfile */ 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); } /** * Get searchTags. * * @return \Doctrine\Common\Collections\Collection */ public function getSearchTags() { return $this->searchTags; } /** * Add companyBenefit. * * @param \App\Entity\CompanyBenefit $companyBenefit * * @return CompanyProfile */ public function addCompanyBenefit(\App\Entity\CompanyBenefit $companyBenefit) { $this->companyBenefits[] = $companyBenefit; return $this; } /** * Remove companyBenefit. * * @param \App\Entity\CompanyBenefit $companyBenefit * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeCompanyBenefit(\App\Entity\CompanyBenefit $companyBenefit) { return $this->companyBenefits->removeElement($companyBenefit); } /** * Get companyBenefits. * * @return \Doctrine\Common\Collections\Collection */ public function getCompanyBenefits() { return $this->companyBenefits; } /** * Set certificateInformation. * * @param string|null $certificateInformation * * @return CompanyProfile */ public function setCertificateInformation($certificateInformation = null) { $this->certificateInformation = $certificateInformation; return $this; } /** * Get certificateInformation. * * @return string|null */ public function getCertificateInformation() { return $this->certificateInformation; } /** * Set user. * * @param \App\Entity\User|null $user * * @return CompanyProfile */ public function setUser(\App\Entity\User $user = null) { $this->user = $user; return $this; } /** * Get user. * * @return \App\Entity\User|null */ public function getUser() { return $this->user; } /** * Set wknr. * * @param string|null $wknr * * @return CompanyProfile */ public function setWknr($wknr = null) { $this->wknr = $wknr; return $this; } /** * Add companyProfileMapping. * * @param \App\Entity\CompanyProfileMapping $companyProfileMapping * * @return CompanyProfile */ public function addCompanyProfileMapping(\App\Entity\CompanyProfileMapping $companyProfileMapping) { $this->companyProfileMappings[] = $companyProfileMapping; return $this; } /** * Remove companyProfileMapping. * * @param \App\Entity\CompanyProfileMapping $companyProfileMapping * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeCompanyProfileMapping(\App\Entity\CompanyProfileMapping $companyProfileMapping) { return $this->companyProfileMappings->removeElement($companyProfileMapping); } /** * Get companyProfileMappings. * * @return \Doctrine\Common\Collections\Collection */ public function getCompanyProfileMappings() { return $this->companyProfileMappings; } /** * Add jobOffer. * * @param \App\Entity\JobMarket $jobOffer * * @return CompanyProfile */ public function addJobOffer(\App\Entity\JobMarket $jobOffer) { $this->jobOffers[] = $jobOffer; return $this; } /** * Remove jobOffer. * * @param \App\Entity\JobMarket $jobOffer * * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. */ public function removeJobOffer(\App\Entity\JobMarket $jobOffer) { return $this->jobOffers->removeElement($jobOffer); } /** * Get jobOffers. * * @return \Doctrine\Common\Collections\Collection */ public function getJobOffers() { return $this->jobOffers; } /** * Get wknr. * * @return string|null */ public function getWknr() { return $this->wknr; } /* !!! must correspond to id in table profile_type !!! */ public function getProfileTypeID() { return 1; } public function hasAddressLatLon() { /* @var $location CompanyLocation */ foreach ($this->locations as $location) { if (!empty($location->getAddress()) && !empty($location->getAddress()->getAddressLatLon())) { return true; } } return false; } /** * Set isVisible. * * @param bool $isVisible * * @return CompanyProfile */ 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->companyProfilePicture)) { return false; } if (strlen($this->description) < 100) { return false; } return true; } public function getShortName() { if (strlen($this->name) < 25) { return $this->name; } $namePart = substr($this->name, 0, 25); return "$namePart..."; } /** * @var \App\Entity\ContactGallery */ private $contactGallery; /** * Set contactGallery. * * @param \App\Entity\ContactGallery|null $contactGallery * * @return CompanyProfile */ 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; } /** * Add interestField * * @param \App\Entity\InterestField $interestField * * @return CompanyProfile */ public function addInterestField(\App\Entity\InterestField $interestField) { $this->interestFields[] = $interestField; return $this; } /** * Remove interestField * * @param \App\Entity\InterestField $interestField */ public function removeInterestField(\App\Entity\InterestField $interestField) { $this->interestFields->removeElement($interestField); } /** * Get interestField * * @return \Doctrine\Common\Collections\Collection */ public function getInterestFields() { return $this->interestFields; } 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 hasJobDailyRoutine() { return false; } public function getOffers() { return $this->offers; } public function setOffers($offers) { $this->offers = $offers; } public function addOffer($offerEntry) { $this->offers[] = $offerEntry; } public function hasOfferID($offerID) { foreach ($this->offers as $offerEntry) { $id = $offerEntry->getOffer()->getId(); if ($offerID == $id) { return true; } } return false; } public function countJobOffers() { $count = 0; $now = new \DateTime(); /* @var $jobOffer JobMarket */ foreach ($this->jobOffers as $jobOffer) { $state = $jobOffer->getJobMarketState(); if (empty($state)) { continue; } $stateID = $state->getId(); if ($stateID != 1) { continue; } $closeDate = $jobOffer->getClosedDate(); if ($now <= $closeDate) { $count++; } } return $count; } public function countJobs() { return count($this->jobs); }}