src/Entity/Communication.php line 11

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\CommunicationEntry;
  7. class Communication {
  8.     /**
  9.      * @var integer
  10.      */
  11.     private $id;
  12.     /**
  13.      * @var \DateTime
  14.      */
  15.     private $createdAt;
  16.     /**
  17.      * @var \Doctrine\Common\Collections\Collection
  18.      */
  19.     private $communicationEntries;
  20.     /**
  21.      * Constructor
  22.      */
  23.     public function __construct() {
  24.         $this->communicationEntries = new \Doctrine\Common\Collections\ArrayCollection();
  25.     }
  26.     /**
  27.      * Get id
  28.      *
  29.      * @return integer
  30.      */
  31.     public function getId() {
  32.         return $this->id;
  33.     }
  34.     /**
  35.      * Set createdAt
  36.      *
  37.      * @param \DateTime $createdAt
  38.      *
  39.      * @return Communication
  40.      */
  41.     public function setCreatedAt($createdAt) {
  42.         $this->createdAt $createdAt;
  43.         return $this;
  44.     }
  45.     /**
  46.      * Get createdAt
  47.      *
  48.      * @return \DateTime
  49.      */
  50.     public function getCreatedAt() {
  51.         return $this->createdAt;
  52.     }
  53.     /**
  54.      * Add communicationEntry
  55.      *
  56.      * @param \App\Entity\CommunicationEntry $communicationEntry
  57.      *
  58.      * @return Communication
  59.      */
  60.     public function addCommunicationEntry(\App\Entity\CommunicationEntry $communicationEntry) {
  61.         $this->communicationEntries[] = $communicationEntry;
  62.         return $this;
  63.     }
  64.     /**
  65.      * Remove communicationEntry
  66.      *
  67.      * @param \App\Entity\CommunicationEntry $communicationEntry
  68.      */
  69.     public function removeCommunicationEntry(\App\Entity\CommunicationEntry $communicationEntry) {
  70.         $this->communicationEntries->removeElement($communicationEntry);
  71.     }
  72.     /**
  73.      * Get communicationEntries
  74.      *
  75.      * @return \Doctrine\Common\Collections\Collection
  76.      */
  77.     public function getCommunicationEntries() {
  78.         return $this->communicationEntries;
  79.     }
  80.     /**
  81.      * Get tele business
  82.      *
  83.      * @return string
  84.      */
  85.     public function getMobileBusiness() {
  86.         /* @var $commEntry CommunicationEntry */
  87.         foreach ($this->communicationEntries as $commEntry) {
  88.             if ($commEntry->getCommunicationType()->getId() == 4) {
  89.                 return $commEntry->getEntryValue();
  90.             }
  91.         }
  92.         return '';
  93.     }
  94.     /**
  95.      * Get tele business
  96.      *
  97.      * @return string
  98.      */
  99.     public function getPhoneBusiness() {
  100.         /* @var $commEntry CommunicationEntry */
  101.         foreach ($this->communicationEntries as $commEntry) {
  102.             if ($commEntry->getCommunicationType()->getId() == 2) {
  103.                 return $commEntry->getEntryValue();
  104.             }
  105.         }
  106.         return '';
  107.     }
  108.     /**
  109.      * Get mail business
  110.      *
  111.      * @return string
  112.      */
  113.     public function getMailBusiness() {
  114.         /* @var $commEntry CommunicationEntry */
  115.         foreach ($this->communicationEntries as $commEntry) {
  116.             if ($commEntry->getCommunicationType()->getId() == 6) {
  117.                 return $commEntry->getEntryValue();
  118.             }
  119.         }
  120.         return '';
  121.     }
  122.     /**
  123.      * Get mail business
  124.      *
  125.      * @return string
  126.      */
  127.     public function getMailDirector() {
  128.         /* @var $commEntry CommunicationEntry */
  129.         foreach ($this->communicationEntries as $commEntry) {
  130.             if ($commEntry->getCommunicationType()->getId() == 9) {
  131.                 return $commEntry->getEntryValue();
  132.             }
  133.         }
  134.         return '';
  135.     }    
  136. }