/** * sets Entity's Main-Fax. * * @param Contact|AccountInterface $entity */ public function setMainFax($entity) { // set main to first entry or to null if ($entity->getFaxes()->isEmpty()) { $entity->setMainFax(null); } else { $entity->setMainFax($entity->getFaxes()->first()->getFax()); } }