Hi,
i would like to export all the phone numbers and e-mails from my accounts.
I try the following but it's not working.
<?php
namespace Espo\Custom\Services;
class Contact extends \Espo\Core\Templates\Services\Person
{
protected $exportAdditionalFieldList = ['phoneNumberOffice'];
public function loadAdditionalFieldsForExport(\Espo\ORM\Entity $entity)
{
parent::loadAdditionalFieldsForExport($entity);
$this->loadPhoneNumberField($entity);
}
protected function getFieldPhoneNumberOfficeFromEntityForExport(\Espo \ORM\Entity $entity)
{
$phoneNumberData = $entity->get('phoneNumberData');
foreach ($phoneNumberData as $d) {
if ($d->type == 'Office') {
return $d->phoneNumber;
}
}
return '';
}
}
?>
i would like to export all the phone numbers and e-mails from my accounts.
I try the following but it's not working.
<?php
namespace Espo\Custom\Services;
class Contact extends \Espo\Core\Templates\Services\Person
{
protected $exportAdditionalFieldList = ['phoneNumberOffice'];
public function loadAdditionalFieldsForExport(\Espo\ORM\Entity $entity)
{
parent::loadAdditionalFieldsForExport($entity);
$this->loadPhoneNumberField($entity);
}
protected function getFieldPhoneNumberOfficeFromEntityForExport(\Espo \ORM\Entity $entity)
{
$phoneNumberData = $entity->get('phoneNumberData');
foreach ($phoneNumberData as $d) {
if ($d->type == 'Office') {
return $d->phoneNumber;
}
}
return '';
}
}
?>
Comment