/** * {@inheritdoc} */ protected function findEntityByIdentityValues($entityName, array $identityValues) { if (is_a($entityName, 'OroCRM\\Bundle\\MagentoBundle\\Entity\\IntegrationAwareInterface', true)) { $identityValues['channel'] = $this->context->getOption('channel'); } return parent::findEntityByIdentityValues($entityName, $identityValues); }
/** * {@inheritdoc} */ protected function findEntityByIdentityValues($entityName, array $identityValues) { // contact last name and first name must be in this order to support compound index if ($entityName == 'OroCRM\\Bundle\\ContactBundle\\Entity\\Contact') { if (array_key_exists('firstName', $identityValues) && array_key_exists('lastName', $identityValues)) { $firstName = $identityValues['firstName']; $lastName = $identityValues['lastName']; unset($identityValues['firstName']); unset($identityValues['lastName']); $identityValues = array_merge(array('lastName' => $lastName, 'firstName' => $firstName), $identityValues); } } return parent::findEntityByIdentityValues($entityName, $identityValues); }