organization = new \Doctrine\Common\Collections\ArrayCollection(); $this->person = new \Doctrine\Common\Collections\ArrayCollection(); $this->place = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Sets id. * * @param int $id * * @return $this */ public function setId($id) { $this->id = $id; return $this; } /** * Gets id. * * @return int */ public function getId() { return $this->id; } /** * Get organization * * @return \Doctrine\Common\Collections\Collection */ public function getOrganization() { return $this->organization; } /** * Get person * * @return \Doctrine\Common\Collections\Collection */ public function getPerson() { return $this->person; } /** * Get place * * @return \Doctrine\Common\Collections\Collection */ public function getPlace() { return $this->place; } /** * Sets contactType. * * @param string $contactType * * @return $this */ public function setContactType($contactType) { $this->contactType = $contactType; return $this; } /** * Gets contactType. * * @return string */ public function getContactType() { return $this->contactType; } /** * Sets email. * * @param string $email * * @return $this */ public function setEmail($email) { $this->email = $email; if(!is_null($email) && !is_null($this->getEmailInvalid())) $this->setEmailInvalid(NULL); return $this; } /** * Gets email. * * @return string */ public function getEmail() { return $this->email; } /** * Sets email Invalid. * * @param string $emailInvalid * * @return $this */ public function setEmailInvalid($emailInvalid) { $this->emailInvalid = is_null($this->email) ? $emailInvalid : NULL; return $this; } /** * Gets email Invalid. * * @return string */ public function getEmailInvalid() { return $this->emailInvalid; } /** * Sets faxNumber. * * @param string $faxNumber * * @return $this */ public function setFaxNumber($faxNumber) { if(empty($faxNumber))$faxNumber = null; if(is_null($faxNumber)) $this->faxNumber = $faxNumber; else{ $phoneUtil = PhoneNumberUtil::getInstance(); $phoneNumber = $phoneUtil->parse($faxNumber, PhoneNumberUtil::UNKNOWN_REGION); $this->faxNumber = $phoneNumber; } if(!is_null($this->faxNumber) && !is_null($this->getFaxNumberInvalid())) $this->setFaxNumberInvalid(NULL); return $this; } /** * Gets faxNumber. * * @return string */ public function getFaxNumber() { return $this->faxNumber; } /** * Sets faxNumber Invalid. * * @param string $faxNumberInvalid * * @return $this */ public function setFaxNumberInvalid($faxNumberInvalid) { $this->faxNumberInvalid = is_null($this->faxNumber) ? $faxNumberInvalid : NULL; return $this; } /** * Gets faxNumber Invalid. * * @return string */ public function getFaxNumberInvalid() { return $this->faxNumberInvalid; } /** * Sets telphone. * * @param string $telphone * * @return $this */ public function setTelphone($telphone) { if(empty($telphone))$telphone = null; if(is_null($telphone)) $this->telphone = $telphone; else{ $phoneUtil = PhoneNumberUtil::getInstance(); $phoneNumber = $phoneUtil->parse($telphone, PhoneNumberUtil::UNKNOWN_REGION); $this->telphone = $phoneNumber; } if(!is_null($this->telphone) && !is_null($this->getTelphoneInvalid())) $this->setTelphoneInvalid(NULL); return $this; } public function setPhoneNumberTelphone(PhoneNumber $phoneNumberTelphone) { $this->telphone = $phoneNumberTelphone; } /** * Gets telphone. * * @return string */ public function getTelphone() { return $this->telphone; } /** * Sets telphone Invalid. * * @param string $telphoneInvalid * * @return $this */ public function setTelphoneInvalid($telphoneInvalid) { $this->telphoneInvalid = is_null($this->telphone) ? $telphoneInvalid : NULL; return $this; } /** * Gets telphone Invalid. * * @return string */ public function getTelphoneInvalid() { return $this->telphoneInvalid; } /** * Sets mobilPhone. * * @param string $mobilPhone * * @return $this */ public function setMobilPhone($mobilPhone) { if(empty($mobilPhone))$mobilPhone = null; if(is_null($mobilPhone)) $this->mobilPhone = $mobilPhone; else{ $phoneUtil = PhoneNumberUtil::getInstance(); $phoneNumber = $phoneUtil->parse($mobilPhone, PhoneNumberUtil::UNKNOWN_REGION); $this->mobilPhone = $phoneNumber; } if(!is_null($this->mobilPhone) && !is_null($this->getMobilPhoneInvalid())) $this->setMobilPhoneInvalid(NULL); return $this; } public function setPhoneNumberMobilPhone(PhoneNumber $phoneNumberMobilPhone){ $this->mobilPhone = $phoneNumberMobilPhone; } /** * Gets mobilPhone. * * @return string */ public function getMobilPhone() { return $this->mobilPhone; } /** * Sets mobilPhone Invalid . * * @param string $mobilPhoneInvalid * * @return $this */ public function setMobilPhoneInvalid($mobilPhoneInvalid) { $this->mobilPhoneInvalid = is_null($this->mobilPhone) ? $mobilPhoneInvalid : NULL; return $this; } /** * Gets mobilPhone Invalid. * * @return string */ public function getMobilPhoneInvalid() { return $this->mobilPhoneInvalid; } /** * Gets full label. * * @return array */ public function getFullLabelTemplate() { return [ $this->getEmail(), $this->getTelphoneTemplate()[0], $this->getMobilPhoneTemplate()[0] ]; } /** * Gets full label. * * @return array */ public function getTelphoneTemplate() { return [ ['type' => 'phone_number', 'value' => $this->getTelphone(), 'separator' => ' / '] ]; } /** * Gets full label. * * @return array */ public function getMobilPhoneTemplate() { return [ ['type' => 'phone_number', 'value' => $this->getMobilPhone(), 'separator' => ' / '] ]; } /** * Add organization * * @param \AppBundle\Entity\Organization\Organization $organization * * @return ContactPoint */ public function addOrganization(\AppBundle\Entity\Organization\Organization $organization) { $this->organization[] = $organization; return $this; } /** * Remove organization * * @param \AppBundle\Entity\Organization\Organization $organization */ public function removeOrganization(\AppBundle\Entity\Organization\Organization $organization) { $this->organization->removeElement($organization); } /** * Add person * * @param \AppBundle\Entity\Person\Person $person * * @return ContactPoint */ public function addPerson(\AppBundle\Entity\Person\Person $person) { $this->person[] = $person; return $this; } /** * Remove person * * @param \AppBundle\Entity\Person\Person $person */ public function removePerson(\AppBundle\Entity\Person\Person $person) { $person->removeContactPoint($this); $this->person->removeElement($person); } /** * Add place * * @param \AppBundle\Entity\Place\Place $place * * @return ContactPoint */ public function addPlace(\AppBundle\Entity\Place\Place $place) { $this->place[] = $place; return $this; } /** * Remove place * * @param \AppBundle\Entity\Place\Place $place */ public function removePlace(\AppBundle\Entity\Place\Place $place) { $this->place->removeElement($place); } /** * Gets invalidReason. * * @return string */ public function getInvalidReason() { return $this->invalidReason; } /** * Sets invalidReason * * @param string $invalidReason * * @return $this */ public function setInvalidReason($invalidReason) { $this->invalidReason = $invalidReason; return $this; } /** * @return string */ public function getInvalidStatus() { return $this->invalidStatus; } /** * @param string $invalidStatus */ public function setInvalidStatus($invalidStatus) { $this->invalidStatus = $invalidStatus; } /** * Gets full label. * * @return array */ public function getFullLabelPrincipalTemplate() { return $this->getFullLabelTemplateByType(ContactPointTypeEnum::PRINCIPAL); } /** * Gets full label. * * @return array */ public function getFullLabelContactTemplate() { return $this->getFullLabelTemplateByType(ContactPointTypeEnum::CONTACT); } /** * Gets full label. * * @return string */ public function getFullLabelBillTemplate() { return $this->getFullLabelTemplateByType(ContactPointTypeEnum::BILL); } /** * @param $contactPointTypeEnum * @return array */ private function getFullLabelTemplateByType($contactPointTypeEnum) { $label = []; if($this->contactType === $contactPointTypeEnum){ $label = [ $this->getEmail(), ['type' => 'phone_number', 'value' => $this->getTelphone()], ['type' => 'phone_number', 'value' => $this->getMobilPhone()] ]; } return $label; } /** * @return string */ public function getInvalidEmailBody() { return $this->invalidEmailBody; } /** * @param string $invalidEmailBody */ public function setInvalidEmailBody($invalidEmailBody) { $this->invalidEmailBody = $invalidEmailBody; } /** * @return string */ public function getInvalidCat() { return $this->invalidCat; } /** * @param string $invalidCat */ public function setInvalidCat($invalidCat) { $this->invalidCat = $invalidCat; } }