src/Entity/SchoolProfile.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\BackendBundle\Interfaces\ProfileInterface;
  7. use App\Entity\OfferEntry;
  8. use App\Entity\SchoolLocation;
  9. class SchoolProfile implements ProfileInterface {
  10.     /**
  11.      * @var integer
  12.      */
  13.     private $id;
  14.     /**
  15.      * @var uuid
  16.      */
  17.     private $uuid;
  18.     /**
  19.      * @var string
  20.      */
  21.     private $name;
  22.     /**
  23.      * @var string
  24.      */
  25.     private $description;
  26.     /**
  27.      * @var string
  28.      */
  29.     private $trainingInformation;
  30.     /**
  31.      * @var string
  32.      */
  33.     private $url;
  34.     /**
  35.      * @var integer
  36.      */
  37.     private $clickCount 0;
  38.     /**
  39.      * @var \App\Entity\School
  40.      */
  41.     private $school;
  42.     /**
  43.      * @var \App\Entity\Communication
  44.      */
  45.     private $communication;
  46.     /**
  47.      * @var \App\Entity\Media
  48.      */
  49.     private $schoolProfilePicture;
  50.     /**
  51.      * @var \App\Entity\Media
  52.      */
  53.     private $headerPicture;
  54.     /**
  55.      * @var \App\Entity\Gallery
  56.      */
  57.     private $gallery;
  58.     /**
  59.      * @var \App\Entity\Gallery
  60.      */
  61.     private $videos;
  62.     /**
  63.      * @var \App\Entity\Gallery
  64.      */
  65.     private $documents;
  66.     /**
  67.      * @var \Doctrine\Common\Collections\Collection
  68.      */
  69.     private $contacts;
  70.     /**
  71.      * @var \Doctrine\Common\Collections\Collection
  72.      */
  73.     private $locations;
  74.     /**
  75.      * @var \Doctrine\Common\Collections\Collection
  76.      */
  77.     private $jobs;
  78.     /**
  79.      * @var \Doctrine\Common\Collections\Collection
  80.      */
  81.     private $schoolBenefits;
  82.     /**
  83.      * @var \Doctrine\Common\Collections\Collection
  84.      */
  85.     private $searchTags;
  86.     /**
  87.      * @var bool
  88.      */
  89.     private $isVisible true;
  90.     /**
  91.      * @var \App\Entity\ProfileLink
  92.      */
  93.     private $profileLink;
  94.     /**
  95.      * @var \Doctrine\Common\Collections\Collection
  96.      */
  97.     private $offers;
  98.     /**
  99.      * @var \Doctrine\Common\Collections\Collection
  100.      */
  101.     private $gameQuizzes;
  102.     /**
  103.      * @var \Doctrine\Common\Collections\Collection
  104.      */
  105.     private $jobDailyRoutines;
  106.     /**
  107.      * @var string|null
  108.      */
  109.     private $certificateInformation;
  110.     /**
  111.      * Constructor
  112.      */
  113.     public function __construct() {
  114.         $this->contacts = new \Doctrine\Common\Collections\ArrayCollection();
  115.         $this->gameQuizzes = new \Doctrine\Common\Collections\ArrayCollection();
  116.         $this->jobs = new \Doctrine\Common\Collections\ArrayCollection();
  117.         $this->locations = new \Doctrine\Common\Collections\ArrayCollection();
  118.         $this->offers = new \Doctrine\Common\Collections\ArrayCollection();
  119.         $this->schoolBenefits = new \Doctrine\Common\Collections\ArrayCollection();
  120.         $this->searchTags = new \Doctrine\Common\Collections\ArrayCollection();
  121.         $this->jobDailyRoutines = new \Doctrine\Common\Collections\ArrayCollection();
  122.     }
  123.     /**
  124.      * Get id
  125.      *
  126.      * @return integer
  127.      */
  128.     public function getId() {
  129.         return $this->id;
  130.     }
  131.     /**
  132.      * Set uuid
  133.      *
  134.      * @param uuid $uuid
  135.      *
  136.      * @return SchoolProfile
  137.      */
  138.     public function setUuid($uuid) {
  139.         $this->uuid $uuid;
  140.         return $this;
  141.     }
  142.     /**
  143.      * Get uuid
  144.      *
  145.      * @return uuid
  146.      */
  147.     public function getUuid() {
  148.         return $this->uuid;
  149.     }
  150.     /**
  151.      * Set name
  152.      *
  153.      * @param string $name
  154.      *
  155.      * @return SchoolProfile
  156.      */
  157.     public function setName($name) {
  158.         $this->name $name;
  159.         return $this;
  160.     }
  161.     /**
  162.      * Get name
  163.      *
  164.      * @return string
  165.      */
  166.     public function getName() {
  167.         return $this->name;
  168.     }
  169.     /**
  170.      * Set description
  171.      *
  172.      * @param string $description
  173.      *
  174.      * @return SchoolProfile
  175.      */
  176.     public function setDescription($description) {
  177.         $this->description $description;
  178.         return $this;
  179.     }
  180.     /**
  181.      * Get description
  182.      *
  183.      * @return string
  184.      */
  185.     public function getDescription() {
  186.         return $this->description;
  187.     }
  188.     /**
  189.      * Set trainingInformation
  190.      *
  191.      * @param string $trainingInformation
  192.      *
  193.      * @return SchoolProfile
  194.      */
  195.     public function setTrainingInformation($trainingInformation) {
  196.         $this->trainingInformation $trainingInformation;
  197.         return $this;
  198.     }
  199.     /**
  200.      * Get trainingInformation
  201.      *
  202.      * @return string
  203.      */
  204.     public function getTrainingInformation() {
  205.         return $this->trainingInformation;
  206.     }
  207.     /**
  208.      * Set url
  209.      *
  210.      * @param string $url
  211.      *
  212.      * @return SchoolProfile
  213.      */
  214.     public function setUrl($url) {
  215.         $this->url $url;
  216.         return $this;
  217.     }
  218.     /**
  219.      * Get url
  220.      *
  221.      * @return string
  222.      */
  223.     public function getUrl() {
  224.         return $this->url;
  225.     }
  226.     /**
  227.      * Set clickCount
  228.      *
  229.      * @param integer $clickCount
  230.      *
  231.      * @return SchoolProfile
  232.      */
  233.     public function setClickCount($clickCount) {
  234.         $this->clickCount $clickCount;
  235.         return $this;
  236.     }
  237.     /**
  238.      * Get clickCount
  239.      *
  240.      * @return integer
  241.      */
  242.     public function getClickCount() {
  243.         return $this->clickCount;
  244.     }
  245.     /**
  246.      * Set school
  247.      *
  248.      * @param \App\Entity\School $school
  249.      *
  250.      * @return SchoolProfile
  251.      */
  252.     public function setSchool(\App\Entity\School $school null) {
  253.         $this->school $school;
  254.         return $this;
  255.     }
  256.     /**
  257.      * Get school
  258.      *
  259.      * @return \App\Entity\School
  260.      */
  261.     public function getSchool() {
  262.         return $this->school;
  263.     }
  264.     /**
  265.      * Set communication
  266.      *
  267.      * @param \App\Entity\Communication $communication
  268.      *
  269.      * @return SchoolProfile
  270.      */
  271.     public function setCommunication(\App\Entity\Communication $communication null) {
  272.         $this->communication $communication;
  273.         return $this;
  274.     }
  275.     /**
  276.      * Get communication
  277.      *
  278.      * @return \App\Entity\Communication
  279.      */
  280.     public function getCommunication() {
  281.         return $this->communication;
  282.     }
  283.     /**
  284.      * Set gallery
  285.      *
  286.      * @param \App\Entity\Gallery $gallery
  287.      *
  288.      * @return SchoolProfile
  289.      */
  290.     public function setGallery(\App\Entity\Gallery $gallery null) {
  291.         $this->gallery $gallery;
  292.         return $this;
  293.     }
  294.     /**
  295.      * Get gallery
  296.      *
  297.      * @return \App\Entity\Gallery
  298.      */
  299.     public function getGallery() {
  300.         return $this->gallery;
  301.     }
  302.     /**
  303.      * Set videos
  304.      *
  305.      * @param \App\Entity\Gallery $videos
  306.      *
  307.      * @return SchoolProfile
  308.      */
  309.     public function setVideos(\App\Entity\Gallery $videos null) {
  310.         $this->videos $videos;
  311.         return $this;
  312.     }
  313.     /**
  314.      * Get videos
  315.      *
  316.      * @return \App\Entity\Gallery
  317.      */
  318.     public function getVideos() {
  319.         return $this->videos;
  320.     }
  321.     /**
  322.      * Set documents
  323.      *
  324.      * @param \App\Entity\Gallery $documents
  325.      *
  326.      * @return SchoolProfile
  327.      */
  328.     public function setDocuments(\App\Entity\Gallery $documents null) {
  329.         $this->documents $documents;
  330.         return $this;
  331.     }
  332.     /**
  333.      * Get documents
  334.      *
  335.      * @return \App\Entity\Gallery
  336.      */
  337.     public function getDocuments() {
  338.         return $this->documents;
  339.     }
  340.     /**
  341.      * Add location
  342.      *
  343.      * @param \App\Entity\SchoolLocation $location
  344.      *
  345.      * @return SchoolProfile
  346.      */
  347.     public function addLocation(\App\Entity\SchoolLocation $location) {
  348.         $this->locations[] = $location;
  349.         return $this;
  350.     }
  351.     /**
  352.      * Remove location
  353.      *
  354.      * @param \App\Entity\SchoolLocation $location
  355.      */
  356.     public function removeLocation(\App\Entity\SchoolLocation $location) {
  357.         $this->locations->removeElement($location);
  358.     }
  359.     /**
  360.      * Get locations
  361.      *
  362.      * @return \Doctrine\Common\Collections\Collection
  363.      */
  364.     public function getLocations() {
  365.         return $this->locations;
  366.     }
  367.     /**
  368.      * Add job
  369.      *
  370.      * @param \App\Entity\Job $job
  371.      *
  372.      * @return SchoolProfile
  373.      */
  374.     public function addJob(\App\Entity\Job $job) {
  375.         $this->jobs[] = $job;
  376.         return $this;
  377.     }
  378.     /**
  379.      * Remove job
  380.      *
  381.      * @param \App\Entity\Job $job
  382.      */
  383.     public function removeJob(\App\Entity\Job $job) {
  384.         $this->jobs->removeElement($job);
  385.     }
  386.     /**
  387.      * Get jobs
  388.      *
  389.      * @return \Doctrine\Common\Collections\Collection
  390.      */
  391.     public function getJobs() {
  392.         return $this->jobs;
  393.     }
  394.     /**
  395.      * Add searchTag.
  396.      *
  397.      * @param \App\Entity\SearchTag $searchTag
  398.      *
  399.      * @return SchoolProfile
  400.      */
  401.     public function addSearchTag(\App\Entity\SearchTag $searchTag) {
  402.         $this->searchTags[] = $searchTag;
  403.         return $this;
  404.     }
  405.     /**
  406.      * Remove searchTag.
  407.      *
  408.      * @param \App\Entity\SearchTag $searchTag
  409.      *
  410.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  411.      */
  412.     public function removeSearchTag(\App\Entity\SearchTag $searchTag) {
  413.         return $this->searchTags->removeElement($searchTag);
  414.     }
  415.     /**
  416.      * Add schoolBenefit.
  417.      *
  418.      * @param \App\Entity\SchoolBenefit $schoolBenefit
  419.      *
  420.      * @return SchoolProfile
  421.      */
  422.     public function addSchoolBenefit(\App\Entity\SchoolBenefit $schoolBenefit) {
  423.         $this->schoolBenefits[] = $schoolBenefit;
  424.         return $this;
  425.     }
  426.     /**
  427.      * Remove schoolBenefit.
  428.      *
  429.      * @param \App\Entity\SchoolBenefit $schoolBenefit
  430.      *
  431.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  432.      */
  433.     public function removeSchoolBenefit(\App\Entity\SchoolBenefit $schoolBenefit) {
  434.         return $this->schoolBenefits->removeElement($schoolBenefit);
  435.     }
  436.     /**
  437.      * Get schoolBenefits.
  438.      *
  439.      * @return \Doctrine\Common\Collections\Collection
  440.      */
  441.     public function getSchoolBenefits() {
  442.         return $this->schoolBenefits;
  443.     }
  444.     /**
  445.      * Get searchTags.
  446.      *
  447.      * @return \Doctrine\Common\Collections\Collection
  448.      */
  449.     public function getSearchTags() {
  450.         return $this->searchTags;
  451.     }
  452.     /**
  453.      * Set schoolProfilePicture.
  454.      *
  455.      * @param \App\Entity\Media|null $schoolProfilePicture
  456.      *
  457.      * @return SchoolProfile
  458.      */
  459.     public function setSchoolProfilePicture(\App\Entity\Media $schoolProfilePicture null) {
  460.         $this->schoolProfilePicture $schoolProfilePicture;
  461.         return $this;
  462.     }
  463.     /**
  464.      * Get schoolProfilePicture.
  465.      *
  466.      * @return \App\Entity\Media|null
  467.      */
  468.     public function getSchoolProfilePicture() {
  469.         return $this->schoolProfilePicture;
  470.     }
  471.     /**
  472.      * Set headerPicture
  473.      *
  474.      * @param \App\Entity\Media $headerPicture
  475.      *
  476.      * @return SchoolProfile
  477.      */
  478.     public function setHeaderPicture(\App\Entity\Media $headerPicture null) {
  479.         $this->headerPicture $headerPicture;
  480.         return $this;
  481.     }
  482.     /**
  483.      * Get headerPicture
  484.      *
  485.      * @return \App\Entity\Media
  486.      */
  487.     public function getHeaderPicture() {
  488.         return $this->headerPicture;
  489.     }
  490.     /**
  491.      * Set certificateInformation.
  492.      *
  493.      * @param string|null $certificateInformation
  494.      *
  495.      * @return SchoolProfile
  496.      */
  497.     public function setCertificateInformation($certificateInformation null) {
  498.         $this->certificateInformation $certificateInformation;
  499.         return $this;
  500.     }
  501.     /**
  502.      * Get certificateInformation.
  503.      *
  504.      * @return string|null
  505.      */
  506.     public function getCertificateInformation() {
  507.         return $this->certificateInformation;
  508.     }
  509.     public function getSchoolTypes() {
  510.         if ($this->school == null) {
  511.             return array();
  512.         }
  513.         return $this->school->getSchoolTypes();
  514.     }
  515.     /* !!! must correspond to id in table profile_type !!! */
  516.     public function getProfileTypeID() {
  517.         return 3;
  518.     }
  519.     public function hasAddressLatLon() {
  520.         /* @var $location SchoolLocation */
  521.         foreach ($this->locations as $location) {
  522.             if (!empty($location->getAddress()) && !empty($location->getAddress()->getAddressLatLon())) {
  523.                 return true;
  524.             }
  525.         }
  526.         return false;
  527.     }
  528.     /**
  529.      * Set isVisible.
  530.      *
  531.      * @param bool $isVisible
  532.      *
  533.      * @return SchoolProfile
  534.      */
  535.     public function setIsVisible($isVisible) {
  536.         $this->isVisible $isVisible;
  537.         return $this;
  538.     }
  539.     /**
  540.      * Get isVisible.
  541.      *
  542.      * @return bool
  543.      */
  544.     public function getIsVisible() {
  545.         return $this->isVisible;
  546.     }
  547.     public function getIsComplete() {
  548.         if (empty($this->schoolProfilePicture)) {
  549.             return false;
  550.         }
  551.         if (strlen($this->description) < 100) {
  552.             return false;
  553.         }
  554.         return true;
  555.     }
  556.     /**
  557.      * @var \App\Entity\ContactGallery
  558.      */
  559.     private $contactGallery;
  560.     /**
  561.      * Set contactGallery.
  562.      *
  563.      * @param \App\Entity\ContactGallery|null $contactGallery
  564.      *
  565.      * @return SchoolProfile
  566.      */
  567.     public function setContactGallery(\App\Entity\ContactGallery $contactGallery null) {
  568.         $this->contactGallery $contactGallery;
  569.         return $this;
  570.     }
  571.     /**
  572.      * Get contactGallery.
  573.      *
  574.      * @return \App\Entity\ContactGallery|null
  575.      */
  576.     public function getContactGallery() {
  577.         return $this->contactGallery;
  578.     }
  579.     public function getInterestFields() {
  580.         if (empty($this->school)) {
  581.             return array();
  582.         }
  583.         return $this->school->getInterestFields();
  584.     }
  585.     public function getProfileLink() {
  586.         return $this->profileLink;
  587.     }
  588.     public function setProfileLink($profileLink) {
  589.         $this->profileLink $profileLink;
  590.     }
  591.     public function getGameQuizzes() {
  592.         return $this->gameQuizzes;
  593.     }
  594.     public function setGameQuizzes($gameQuizzes) {
  595.         $this->gameQuizzes $gameQuizzes;
  596.     }
  597.     public function hasGameQuizzes() {
  598.         if (count($this->gameQuizzes) > 0) {
  599.             return true;
  600.         }
  601.         return false;
  602.     }
  603.     public function getJobDailyRoutines() {
  604.         return $this->jobDailyRoutines;
  605.     }
  606.     public function setJobDailyRoutines($jobDailyRoutines) {
  607.         $this->jobDailyRoutines $jobDailyRoutines;
  608.     }
  609.     public function addJobDailyRoutine($jobDailyRoutine) {
  610.         $this->jobDailyRoutines->add($jobDailyRoutine);
  611.     }
  612.     public function hasJobDailyRoutine() {
  613.         if (count($this->jobDailyRoutines) > 0) {
  614.             return true;
  615.         }
  616.         return false;
  617.     }
  618.     public function getOffers() {
  619.         return $this->offers;
  620.     }
  621.     public function setOffers($offers) {
  622.         $this->offers $offers;
  623.     }
  624.     public function addOffer($offerEntry) {
  625.         $this->offers[] = $offerEntry;
  626.     }
  627.     public function getOfferEntryByOfferID($offerID) {
  628.         if (empty($this->offers)) {
  629.             return null;
  630.         }
  631.         foreach ($this->offers as $offerEntry) {
  632.             $entryOfferID $offerEntry->getOffer()->getId();
  633.             if ($entryOfferID == $offerID) {
  634.                 return $offerEntry;
  635.             }
  636.         }
  637.         return null;
  638.     }
  639.     public function hasOfferID($offerID) {
  640.         foreach ($this->offers as $offerEntry) {
  641.             $id $offerEntry->getOffer()->getId();
  642.             if ($offerID == $id) {
  643.                 return true;
  644.             }
  645.         }
  646.         return false;
  647.     }
  648.     public function countJobOffers() {
  649.         return 0;
  650.     }
  651.     public function countJobs() {
  652.         return count($this->jobs);
  653.     }
  654. }