protected function addFax($contact, $faxData)
{
$faxEntity = 'SuluContactBundle:Fax';
$faxType = $this->em->getRepository(self::$faxTypeEntityName)->find($faxData['faxType']['id']);
if (isset($faxData['id'])) {
throw new EntityIdAlreadySetException($faxEntity, $faxData['id']);
} elseif (!$faxType) {
throw new EntityNotFoundException(self::$faxTypeEntityName, $faxData['faxType']['id']);
} else {
$fax = new Fax();
$fax->setFax($faxData['fax']);
$fax->setFaxType($faxType);
$this->em->persist($fax);
$contact->addFax($fax);
}
}