function hasPhone($number, $phone_type, $isMain = false, $name = "")
 {
     $type_id = TelephoneTypes::getTelephoneTypeId($phone_type);
     $obj = ContactTelephones::instance()->findOne(array('conditions' => array('contact_id=? AND telephone_type_id=? AND number=?', $this->getId(), $type_id, $number)));
     return $obj instanceof ContactTelephone;
 }
Beispiel #2
0
 /**
  * 
  * Add phone to the contact
  * @param string $number
  * @param int $phone_type
  * @param boolean $isMain
  * @author Seba
  */
 function addPhone($number, $phone_type, $isMain = false)
 {
     $phone = new ContactTelephone();
     $phone->setNumber($number);
     $phone->setTelephoneTypeId(TelephoneTypes::getTelephoneTypeId($phone_type));
     $phone->setContactId($this->getId());
     $phone->setIsMain($isMain);
     $phone->save();
 }