Exemplo n.º 1
0
 /**
  * @param Contact $entity
  */
 protected function processSingleRelations(Contact $entity)
 {
     // update source
     $source = $entity->getSource();
     if ($source) {
         $entity->setSource($this->findExistingEntity($source));
     }
     // update method
     $method = $entity->getMethod();
     if ($method) {
         $entity->setMethod($this->findExistingEntity($method));
     }
     // update assigned to
     $assignedTo = $entity->getAssignedTo();
     if ($assignedTo) {
         $entity->setAssignedTo($this->findExistingEntity($assignedTo));
     }
     // clear reports to
     $entity->setReportsTo(null);
     // update created by
     $createdBy = $entity->getCreatedBy();
     if ($createdBy) {
         $entity->setCreatedBy($this->findExistingEntity($createdBy));
     }
     // update updated by
     $updatedBy = $entity->getUpdatedBy();
     if ($updatedBy) {
         $entity->setUpdatedBy($this->findExistingEntity($updatedBy));
     }
 }