src/Entity/School.php line 10

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\Entity\SchoolType;
  7. class School {
  8.     /**
  9.      * @var integer
  10.      */
  11.     private $id;
  12.     /**
  13.      * @var string
  14.      */
  15.     private $name;
  16.     /**
  17.      * @var string
  18.      */
  19.     private $schoolNumber;
  20.     /**
  21.      * @var string
  22.      */
  23.     private $url;
  24.     /**
  25.      * @var boolean
  26.      */
  27.     private $isActive true;
  28.     /**
  29.      * @var \DateTime
  30.      */
  31.     private $createdAt;
  32.     /**
  33.      * @var \App\Entity\Communication
  34.      */
  35.     private $communication;
  36.     /**
  37.      * @var \Doctrine\Common\Collections\Collection
  38.      */
  39.     private $schoolClasses;
  40.     /**
  41.      * @var \Doctrine\Common\Collections\Collection
  42.      */
  43.     private $schoolDirectorMappings;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      */
  47.     private $schoolTeacherMappings;
  48.     /**
  49.      * @var \Doctrine\Common\Collections\Collection
  50.      */
  51.     private $schoolTypes;
  52.     /**
  53.      * @var \App\Entity\Address
  54.      */
  55.     private $address;
  56.     /**
  57.      * @var \App\Entity\SchoolProfile
  58.      */
  59.     private $schoolProfile;
  60.     /**
  61.      * @var \Doctrine\Common\Collections\Collection
  62.      */
  63.     private $jobSchools;
  64.     /**
  65.      * @var \Doctrine\Common\Collections\Collection
  66.      */
  67.     private $interestFields;
  68.     /**
  69.      * Constructor
  70.      */
  71.     public function __construct() {
  72.         $this->interestFields = new \Doctrine\Common\Collections\ArrayCollection();
  73.         $this->jobSchools = new \Doctrine\Common\Collections\ArrayCollection();
  74.         $this->schoolClasses = new \Doctrine\Common\Collections\ArrayCollection();
  75.         $this->schoolDirectorMappings = new \Doctrine\Common\Collections\ArrayCollection();
  76.         $this->schoolTeacherMappings = new \Doctrine\Common\Collections\ArrayCollection();
  77.         $this->schoolTypes = new \Doctrine\Common\Collections\ArrayCollection();
  78.     }
  79.     /**
  80.      * Get id
  81.      *
  82.      * @return integer
  83.      */
  84.     public function getId() {
  85.         return $this->id;
  86.     }
  87.     /**
  88.      * Set name
  89.      *
  90.      * @param string $name
  91.      *
  92.      * @return School
  93.      */
  94.     public function setName($name) {
  95.         $this->name $name;
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get name
  100.      *
  101.      * @return string
  102.      */
  103.     public function getName() {
  104.         return $this->name;
  105.     }
  106.     /**
  107.      * Set schoolNumber
  108.      *
  109.      * @param string $schoolNumber
  110.      *
  111.      * @return School
  112.      */
  113.     public function setSchoolNumber($schoolNumber) {
  114.         $this->schoolNumber $schoolNumber;
  115.         return $this;
  116.     }
  117.     /**
  118.      * Get schoolNumber
  119.      *
  120.      * @return string
  121.      */
  122.     public function getSchoolNumber() {
  123.         return $this->schoolNumber;
  124.     }
  125.     /**
  126.      * Set url
  127.      *
  128.      * @param string $url
  129.      *
  130.      * @return School
  131.      */
  132.     public function setUrl($url) {
  133.         $this->url $url;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Get url
  138.      *
  139.      * @return string
  140.      */
  141.     public function getUrl() {
  142.         return $this->url;
  143.     }
  144.     /**
  145.      * Set isActive
  146.      *
  147.      * @param boolean $isActive
  148.      *
  149.      * @return School
  150.      */
  151.     public function setIsActive($isActive) {
  152.         $this->isActive $isActive;
  153.         return $this;
  154.     }
  155.     /**
  156.      * Get isActive
  157.      *
  158.      * @return boolean
  159.      */
  160.     public function getIsActive() {
  161.         return $this->isActive;
  162.     }
  163.     /**
  164.      * Set createdAt
  165.      *
  166.      * @param \DateTime $createdAt
  167.      *
  168.      * @return School
  169.      */
  170.     public function setCreatedAt($createdAt) {
  171.         $this->createdAt $createdAt;
  172.         return $this;
  173.     }
  174.     /**
  175.      * Get createdAt
  176.      *
  177.      * @return \DateTime
  178.      */
  179.     public function getCreatedAt() {
  180.         return $this->createdAt;
  181.     }
  182.     /**
  183.      * Set communication
  184.      *
  185.      * @param \App\Entity\Communication $communication
  186.      *
  187.      * @return School
  188.      */
  189.     public function setCommunication(\App\Entity\Communication $communication null) {
  190.         $this->communication $communication;
  191.         return $this;
  192.     }
  193.     /**
  194.      * Get communication
  195.      *
  196.      * @return \App\Entity\Communication
  197.      */
  198.     public function getCommunication() {
  199.         return $this->communication;
  200.     }
  201.     /**
  202.      * Add schoolClass
  203.      *
  204.      * @param \App\Entity\SchoolClass $schoolClass
  205.      *
  206.      * @return School
  207.      */
  208.     public function addSchoolClass(\App\Entity\SchoolClass $schoolClass) {
  209.         $this->schoolClasses[] = $schoolClass;
  210.         return $this;
  211.     }
  212.     /**
  213.      * Remove schoolClass
  214.      *
  215.      * @param \App\Entity\SchoolClass $schoolClass
  216.      */
  217.     public function removeSchoolClass(\App\Entity\SchoolClass $schoolClass) {
  218.         $this->schoolClasses->removeElement($schoolClass);
  219.     }
  220.     /**
  221.      * Get schoolClasses
  222.      *
  223.      * @return \Doctrine\Common\Collections\Collection
  224.      */
  225.     public function getSchoolClasses() {
  226.         return $this->schoolClasses;
  227.     }
  228.     /**
  229.      * Add schoolDirectorMapping
  230.      *
  231.      * @param \App\Entity\SchoolDirectorMapping $schoolDirectorMapping
  232.      *
  233.      * @return School
  234.      */
  235.     public function addSchoolDirectorMapping(\App\Entity\SchoolDirectorMapping $schoolDirectorMapping) {
  236.         $this->schoolDirectorMappings[] = $schoolDirectorMapping;
  237.         return $this;
  238.     }
  239.     /**
  240.      * Remove schoolDirectorMapping
  241.      *
  242.      * @param \App\Entity\SchoolDirectorMapping $schoolDirectorMapping
  243.      */
  244.     public function removeSchoolDirectorMapping(\App\Entity\SchoolDirectorMapping $schoolDirectorMapping) {
  245.         $this->schoolDirectorMappings->removeElement($schoolDirectorMapping);
  246.     }
  247.     /**
  248.      * Get schoolDirectorMappings
  249.      *
  250.      * @return \Doctrine\Common\Collections\Collection
  251.      */
  252.     public function getSchoolDirectorMappings() {
  253.         return $this->schoolDirectorMappings;
  254.     }
  255.     /**
  256.      * Add schoolTeacherMapping
  257.      *
  258.      * @param \App\Entity\SchoolTeacherMapping $schoolTeacherMapping
  259.      *
  260.      * @return School
  261.      */
  262.     public function addSchoolTeacherMapping(\App\Entity\SchoolTeacherMapping $schoolTeacherMapping) {
  263.         $this->schoolTeacherMappings[] = $schoolTeacherMapping;
  264.         return $this;
  265.     }
  266.     /**
  267.      * Remove schoolTeacherMapping
  268.      *
  269.      * @param \App\Entity\SchoolTeacherMapping $schoolTeacherMapping
  270.      */
  271.     public function removeSchoolTeacherMapping(\App\Entity\SchoolTeacherMapping $schoolTeacherMapping) {
  272.         $this->schoolTeacherMappings->removeElement($schoolTeacherMapping);
  273.     }
  274.     /**
  275.      * Get schoolTeacherMappings
  276.      *
  277.      * @return \Doctrine\Common\Collections\Collection
  278.      */
  279.     public function getSchoolTeacherMappings() {
  280.         return $this->schoolTeacherMappings;
  281.     }
  282.     /**
  283.      * Add schoolType
  284.      *
  285.      * @param \App\Entity\SchoolType $schoolType
  286.      *
  287.      * @return School
  288.      */
  289.     public function addSchoolType(\App\Entity\SchoolType $schoolType) {
  290.         $this->schoolTypes[] = $schoolType;
  291.         return $this;
  292.     }
  293.     /**
  294.      * Remove schoolType
  295.      *
  296.      * @param \App\Entity\SchoolType $schoolType
  297.      */
  298.     public function removeSchoolType(\App\Entity\SchoolType $schoolType) {
  299.         $this->schoolTypes->removeElement($schoolType);
  300.     }
  301.     /**
  302.      * Get schoolTypes
  303.      *
  304.      * @return \Doctrine\Common\Collections\Collection
  305.      */
  306.     public function getSchoolTypes() {
  307.         return $this->schoolTypes;
  308.     }
  309.     /**
  310.      * Set address.
  311.      *
  312.      * @param \App\Entity\Address|null $address
  313.      *
  314.      * @return School
  315.      */
  316.     public function setAddress(\App\Entity\Address $address null) {
  317.         $this->address $address;
  318.         return $this;
  319.     }
  320.     /**
  321.      * Get address.
  322.      *
  323.      * @return \App\Entity\Address|null
  324.      */
  325.     public function getAddress() {
  326.         return $this->address;
  327.     }
  328.     /**
  329.      * Set schoolProfile.
  330.      *
  331.      * @param \App\Entity\SchoolProfile|null $schoolProfile
  332.      *
  333.      * @return School
  334.      */
  335.     public function setSchoolProfile(\App\Entity\SchoolProfile $schoolProfile null) {
  336.         $this->schoolProfile $schoolProfile;
  337.         return $this;
  338.     }
  339.     /**
  340.      * Get schoolProfile.
  341.      *
  342.      * @return \App\Entity\SchoolProfile|null
  343.      */
  344.     public function getSchoolProfile() {
  345.         return $this->schoolProfile;
  346.     }
  347.     /**
  348.      * Add jobSchool.
  349.      *
  350.      * @param \App\Entity\JobSchool $jobSchool
  351.      *
  352.      * @return School
  353.      */
  354.     public function addJobSchool(\App\Entity\JobSchool $jobSchool) {
  355.         $this->jobSchools[] = $jobSchool;
  356.         return $this;
  357.     }
  358.     /**
  359.      * Remove jobSchool.
  360.      *
  361.      * @param \App\Entity\JobSchool $jobSchool
  362.      *
  363.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  364.      */
  365.     public function removeJobSchool(\App\Entity\JobSchool $jobSchool) {
  366.         return $this->jobSchools->removeElement($jobSchool);
  367.     }
  368.     /**
  369.      * Get jobSchools.
  370.      *
  371.      * @return \Doctrine\Common\Collections\Collection
  372.      */
  373.     public function getJobSchools() {
  374.         return $this->jobSchools;
  375.     }
  376.     /**
  377.      * Add interestField
  378.      *
  379.      * @param \App\Entity\InterestField $interestField
  380.      *
  381.      * @return Job
  382.      */
  383.     public function addInterestField(\App\Entity\InterestField $interestField) {
  384.         $this->interestFields[] = $interestField;
  385.         return $this;
  386.     }
  387.     /**
  388.      * Remove interestField
  389.      *
  390.      * @param \App\Entity\InterestField $interestField
  391.      */
  392.     public function removeInterestField(\App\Entity\InterestField $interestField) {
  393.         $this->interestFields->removeElement($interestField);
  394.     }
  395.     /**
  396.      * Get interestField
  397.      *
  398.      * @return \Doctrine\Common\Collections\Collection
  399.      */
  400.     public function getInterestFields() {
  401.         return $this->interestFields;
  402.     }
  403.     public function getSchoolTypesText() {
  404.         $text '';
  405.         /* @var $schoolType SchoolType */
  406.         foreach ($this->schoolTypes as $schoolType) {
  407.             $text $text $schoolType->getShortName() . ', ';
  408.         }
  409.         if (strlen($text) > 1) {
  410.             $text substr($text0, -2);
  411.         }
  412.         return $text;
  413.     }
  414.     public function isPTS() {
  415.         /* @var $schoolType SchoolType */
  416.         foreach ($this->schoolTypes as $schoolType) {
  417.             if ($schoolType->getId() == 4) {
  418.                 return true;
  419.             }
  420.         }
  421.         return false;
  422.     }
  423.     public function isNMS() {
  424.         /* @var $schoolType SchoolType */
  425.         foreach ($this->schoolTypes as $schoolType) {
  426.             if ($schoolType->getId() == 2) {
  427.                 return true;
  428.             }
  429.         }
  430.         return false;
  431.     }
  432.     public function isASO() {
  433.         /* @var $schoolType SchoolType */
  434.         foreach ($this->schoolTypes as $schoolType) {
  435.             if ($schoolType->getId() == 3) {
  436.                 return true;
  437.             }
  438.         }
  439.         return false;
  440.     }
  441.     public function getHttpUrl() {
  442.         if (empty($this->url)) {
  443.             return '';
  444.         }
  445.         $urlLower strtolower($this->url);
  446.         $prefix '';
  447.         if (strpos($this->url'http') == FALSE) {
  448.             $prefix 'https://';
  449.         }
  450.         return $prefix $urlLower;
  451.     }
  452.     /**
  453.      * @var \Doctrine\Common\Collections\Collection
  454.      */
  455.     private $schoolAwards;
  456.     /**
  457.      * Add schoolAward.
  458.      *
  459.      * @param \App\Entity\SchoolAward $schoolAward
  460.      *
  461.      * @return School
  462.      */
  463.     public function addSchoolAward(\App\Entity\SchoolAward $schoolAward) {
  464.         $this->schoolAwards[] = $schoolAward;
  465.         return $this;
  466.     }
  467.     /**
  468.      * Remove schoolAward.
  469.      *
  470.      * @param \App\Entity\SchoolAward $schoolAward
  471.      *
  472.      * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  473.      */
  474.     public function removeSchoolAward(\App\Entity\SchoolAward $schoolAward) {
  475.         return $this->schoolAwards->removeElement($schoolAward);
  476.     }
  477.     /**
  478.      * Get schoolAwards.
  479.      *
  480.      * @return \Doctrine\Common\Collections\Collection
  481.      */
  482.     public function getSchoolAwards() {
  483.         return $this->schoolAwards;
  484.     }
  485. }