Programming Language PHP

Namespace Oro\Component\PhpUtils

Class ArrayUtil

Method/Function find

Total Examples 1

1 code examples of PHP Oro\Component\PhpUtils\ArrayUtil::find extracted from open source projects

Was this example useful?
0
                                                    /**
     * @param object|string $entityOrClass
     */
    private function findEmailOwnerProvider($entityOrClass): ?EmailOwnerProviderInterface
    {
        $entityClass = is_object($entityOrClass) ? ClassUtils::getClass($entityOrClass) : $entityOrClass;

        return ArrayUtil::find(
            function (EmailOwnerProviderInterface $provider) use ($entityOrClass, $entityClass) {
                return $provider->getEmailOwnerClass() === $entityClass
                    && $this->activityListChainProvider->isSupportedTargetEntity($entityOrClass);
            },
            $this->emailOwnerStorage->getProviders()
        );
    }