Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'roles':
             $result = array();
             /** @var Role $role */
             foreach ($value as $index => $role) {
                 $result[$index] = array('id' => $role->getId(), 'role' => $role->getRole(), 'label' => $role->getLabel());
             }
             $value = $result;
             break;
         case 'owner':
             if ($value) {
                 $value = array('id' => $value->getId(), 'name' => $value->getName());
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'owner':
         case 'updatedBy':
             if ($value) {
                 $value = $value->getId();
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'owner':
             if ($value) {
                 $value = array('id' => $value->getId(), 'name' => $value->getName());
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'case':
         case 'owner':
         case 'contact':
             if ($value) {
                 /** @var CaseEntity $value */
                 $value = $value->getId();
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 5
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'roles':
             $result = array();
             /** @var Role $role */
             foreach ($value as $index => $role) {
                 $result[$index] = array('id' => $role->getId(), 'role' => $role->getRole(), 'label' => $role->getLabel());
             }
             $value = $result;
             break;
         case 'groups':
             $result = array();
             /** @var Group $group */
             foreach ($value as $index => $group) {
                 $result[$index] = array('id' => $group->getId(), 'name' => $group->getName());
             }
             $value = $result;
             break;
         case 'emails':
             $result = array();
             /** @var Email $email */
             foreach ($value as $email) {
                 $result[] = $email->getEmail();
             }
             $value = $result;
             break;
         case 'businessUnits':
             $result = array();
             /** @var BusinessUnit $businessUnit */
             foreach ($value as $index => $businessUnit) {
                 $result[$index] = array('id' => $businessUnit->getId(), 'name' => $businessUnit->getName());
             }
             $value = $result;
             break;
         case 'owner':
             if ($value) {
                 $value = array('id' => $value->getId(), 'name' => $value->getName());
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'country':
             $value = array('iso2code' => $value->getIso2Code(), 'iso3code' => $value->getIso3Code(), 'name' => $value->getName());
             break;
         case 'state':
             $value = array('code' => $value->getCode(), 'name' => $value->getName());
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'status':
             if ($value) {
                 /** @var PartnerStatus $value */
                 $value = $value->getName();
             }
             break;
         case 'owner':
         case 'account':
             if ($value) {
                 $value = $value->getId();
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 8
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'taskPriority':
             if ($value) {
                 $value = $value->getName();
             }
             break;
         case 'owner':
         case 'workflowItem':
         case 'workflowStep':
             if ($value) {
                 $value = $value->getId();
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }
Esempio n. 9
0
 /**
  * {@inheritdoc}
  */
 protected function transformEntityField($field, &$value)
 {
     switch ($field) {
         case 'source':
         case 'priority':
         case 'status':
             if ($value) {
                 /** @var CaseSource|CaseStatus $value */
                 $value = $value->getName();
             }
             break;
         case 'owner':
         case 'assignedTo':
         case 'relatedContact':
         case 'relatedAccount':
             if ($value) {
                 $value = $value->getId();
             }
             break;
         default:
             parent::transformEntityField($field, $value);
     }
 }