fix email address lookup

This commit is contained in:
yuri
2019-10-16 15:39:23 +03:00
parent 7b241b90a0
commit 542d78425c
+8 -1
View File
@@ -67,8 +67,15 @@ class EmailAddress extends Record
$selectManager = $this->getSelectManagerFactory()->create($entityType);
$selectManager->applyAccess($selectParams);
$select = ['id', 'emailAddress', 'name'];
if ($this->getMetadata()->get(['entityDefs', $entityType, 'fields', 'name', 'type']) === 'personName') {
$select[] = 'firstName';
$select[] = 'lastName';
}
$collection = $this->getEntityManager()->getRepository($entityType)
->select(['id', 'emailAddress', 'name'])
->select($select)
->find($selectParams);
foreach ($collection as $entity) {