Pimcore\WorkflowManagement\Workflow\Service::getNotificationUsers PHP Метод

getNotificationUsers() приватный статический Метод

Returns a list of users given an array of ID's if an ID is a role, all users associated with that role will also be returned.
private static getNotificationUsers ( $userIds )
$userIds
    private static function getNotificationUsers($userIds)
    {
        $notifyUsers = [];
        //get roles
        $roleList = new User\Role\Listing();
        $roleList->setCondition('id in (?)', [implode(',', $userIds)]);
        foreach ($roleList->load() as $role) {
            $userList = new User\Listing();
            $userList->setCondition('FIND_IN_SET(?, roles) > 0', [$role->getId()]);
            foreach ($userList->load() as $user) {
                if ($user->getEmail()) {
                    $notifyUsers[] = $user;
                }
            }
        }
        unset($roleList, $user, $role);
        //get users
        $roleList = new User\Listing();
        $roleList->setCondition('id in (?)', [implode(',', $userIds)]);
        foreach ($roleList->load() as $user) {
            /**
             * @var User $user
             */
            if ($user->getEmail()) {
                $notifyUsers[] = $user;
            }
        }
        return $notifyUsers;
    }