setMainPhone() публичный Метод

Set mainPhone.
public setMainPhone ( string $mainPhone ) : Sulu\Bundle\ContactBundle\Entity\AccountInterface
$mainPhone string
Результат Sulu\Bundle\ContactBundle\Entity\AccountInterface
Пример #1
0
 /**
  * sets Entity's Main-Phone.
  *
  * @param Contact|AccountInterface $entity
  */
 public function setMainPhone($entity)
 {
     // set main to first entry or to null
     if ($entity->getPhones()->isEmpty()) {
         $entity->setMainPhone(null);
     } else {
         $entity->setMainPhone($entity->getPhones()->first()->getPhone());
     }
 }