/**
* @return array|CustomerIdentityInterface[]
*/
protected function getChangedTrackedEntities()
{
$entities = array_merge($this->uow->getScheduledEntityInsertions(), $this->uow->getScheduledEntityDeletions(), $this->uow->getScheduledEntityUpdates());
$collections = array_merge($this->uow->getScheduledCollectionDeletions(), $this->uow->getScheduledCollectionUpdates());
/** @var PersistentCollection $collectionToChange */
foreach ($collections as $collectionToChange) {
$entities = array_merge($entities, $collectionToChange->unwrap()->toArray());
}
return array_filter($entities, function ($entity) {
return $entity instanceof CustomerIdentityInterface && array_key_exists(ClassUtils::getClass($entity), $this->customerIdentities);
});
}