{@inheritdoc}

@see Category::getRecipientIDs()
342189
protected function getRecipientIDs(NotificationEntity $notification)
    {
        $result = [];
        $notificationData = $notification->getNotificationData();
        $locale = $this->app->make(LocaleRepository::class)->findApproved($notificationData['localeID']);
        if ($locale === null) {
            throw new Exception(t('Unable to find the locale with ID %s', $notificationData['localeID']));
        }
        $uir = $this->app->make(UserInfoRepository::class);
        $applicantUser = $uir->getByID($notificationData['applicantUserID']);
        if ($applicantUser === null) {
            throw new Exception(t('Unable to find the user with ID %s', $notificationData['applicantUserID']));
        }
        /* @var UserInfo $applicantUser */
        if (!$applicantUser->getUserObject()->inGroup($this->getGroupsHelper()->getAspiringTranslators($locale))) {
            throw new Exception(t(
                'The user %1$s is no more in the aspiring translators of %2$s',
                sprintf('%s (%s)', $applicantUser->getUserName(), $applicantUser->getUserID()),
                $locale->getDisplayName()
            ));
        }
        $group = $this->getGroupsHelper()->getAdministrators($locale);
        $result = array_merge($result, $group->getGroupMemberIDs());
        $group = $this->getGroupsHelper()->getGlobalAdministrators();
        $result = array_merge($result, $group->getGroupMemberIDs());

        return $result;
    }
879473
protected function getFieldIds($contentId, array $fieldIdentifiers)
    {
        $ids = [];
        foreach ($fieldIdentifiers as $identifier) {
            try {
                $ids[] = $this->contentTypeUtils->getFieldId($contentId, $identifier);
            } catch (OutOfBoundsException $e) {
                continue;
            }
        }

        return $ids;
    }
733733
protected static function formRecipients($inputRecipients, PDFfiller $provider, $signatureRequestId)
    {
        $recipients = [];

        foreach ($inputRecipients as $recipient) {
            $recipients[$recipient['id']] = new SignatureRequestRecipient($provider, $recipient, $signatureRequestId);
        }

        return $recipients;
    }
1166396
public function getRecipientsTypeAllowableValues()
    {
        return [
            self::RECIPIENTS_TYPE_ALL,
            self::RECIPIENTS_TYPE_DELIVERED,
            self::RECIPIENTS_TYPE_ANSWERED,
            self::RECIPIENTS_TYPE_SOFT_BOUNCES,
            self::RECIPIENTS_TYPE_HARD_BOUNCES,
            self::RECIPIENTS_TYPE_UNSUBSCRIBED,
        ];
    }
1313530
private static function _usersToRecipients($users)
    {
        $out = array();

        if (!is_array($users)) {
            $users = array($users);
        };

        foreach ($users as $id) {
            $user = grab('user_resolve', $id);
            if ($user !== false) {
                if ($user['name'] !== '') {
                    $out[] = '' . filter('clean_name', $user['name']) . ' <' . $user['email'] . '>';
                } else {
                    $out[] = $user['email'];
                };
            };
        };

        return (count($out) > 0) ? implode(', ', $out) : null;
    }
839202
public function getNewRegistrationIds()
    {
        if ($this->getNewRegistrationIdsCount() == 0) {
            return array();
        }
        $filteredResults = array_filter(
            $this->results,
            function ($result) {
                return isset($result['registration_id']);
            }
        );

        $data = array_map(function ($result) {
                return $result['registration_id'];
        }, $filteredResults);

        return $data;
    }
1266774
public function findAllForRecipient(IdentifierRecipientInterface $recipient)
    {
        $builder = $this->createQueryBuilder('notification');

        $this->addRecipientConditions($builder, $recipient);

        return $builder->getQuery()->getResult();
    }
1309110
public function getRecipients(NotificationEntity $notification)
    {
        $ids = $this->getRecipientIDs($notification);
        // be sure we have integers
        $ids = array_map('intval', $ids);
        // remove problematic IDs
        $ids = array_filter($ids);
        // remove duplicated
        $ids = array_unique($ids, SORT_REGULAR);
        if (!empty($ids)) {
            $repo = $this->app->make(UserInfoRepository::class);
            /* @var UserInfoRepository $repo */
            foreach ($ids as $id) {
                $userInfo = $repo->getByID($id);
                if ($userInfo !== null && $userInfo->isActive()) {
                    yield $userInfo;
                }
            }
        }
    }
1234415
public function getRecipientsFromPost(array $referenced_entity) {
    $recipients = [];

    $post = Post::load($referenced_entity['target_id']);
    $recipient_user = $post->get('field_recipient_user')->getValue();
    if (!empty($recipient_user)) {
      $recipients[] = [
        'target_type' => 'user',
        'target_id' => $recipient_user['0']['target_id'],
      ];
    }

    return $recipients;
  }
465716
protected function getRecipientIDs(NotificationEntity $notification)
    {
        $notificationData = $notification->getNotificationData();
        $locale = $this->app->make(LocaleRepository::class)->find($notificationData['localeID']);
        if ($locale === null && $locale->isApproved()) {
            // The request has already been approved/refused
            $result = [];
        } else {
            $group = $this->getGroupsHelper()->getGlobalAdministrators();
            $result = $group->getGroupMemberIDs();
        }

        return $result;
    }
43761
public function getEndAttemptIdentifiers() {
        $endAttemptIdentifiers = new IdentifierCollection();
        
        foreach ($this->getComponentsByClassName('endAttemptInteraction') as $endAttemptInteraction) {
            $endAttemptIdentifiers[] = $endAttemptInteraction->getResponseIdentifier();
        }
        
        return $endAttemptIdentifiers;
    }
233277
public function getChildrenDsIds($dsId, $level = 1)
    {
        $childrenDsIds = (array_key_exists($dsId, $this->childrenMap))
            ? $this->childrenMap[$dsId]
            : [];

        if (($level > 1) && count($childrenDsIds)) {
            $subChildDsIds = [$childrenDsIds];

            foreach ($childrenDsIds as $childDsId) {
                $subChildDsIds[] = $this->getChildrenDsIds($childDsId, $level - 1);
            }

            $childrenDsIds = call_user_func_array('array_merge', $subChildDsIds);
        }

        return $childrenDsIds;
    }
606522
public function getSimilarRecommListIds()
    {
        if ($this->_aSimilarRecommListIds === null) {
            $this->_aSimilarRecommListIds = false;

            $aWishProdList = $this->getWishProductList();
            if (is_array($aWishProdList) && ($oSimilarProd = current($aWishProdList))) {
                $this->_aSimilarRecommListIds = [$oSimilarProd->getId()];
            }
        }

        return $this->_aSimilarRecommListIds;
    }
1156296
protected function flushRecipients($closure)
    {
        $recipients = (array)$this->temporaryTo;
        $this->temporaryTo = null;

        if(!$recipients && !is_callable($closure)){
            throw new BadMethodCallException('Recipient not determinable: Neither a recipient was set by to() nor a callable was passed');
        }

        return $recipients;
    }
381570
public function getRecibos()
    {
        // si no hay recibos se deben crear
        if (!$this->recibos) {
            // si no está creado el arrelgo con los datos error
            if (!$this->arreglo) {
                return false;
            }
            // crear recibos a partir del arreglo
            $Recibos = $this->arreglo['EnvioRecibos']['SetRecibos']['Recibo'];
            if (!isset($Recibos[0]))
                $Recibos = [$Recibos];
            foreach ($Recibos as $Recibo) {
                $this->recibos[] = $Recibo;
            }
        }
        // entregar recibos
        return $this->recibos;
    }
66138
public function getObjectIdentifierFromData(array $data) : array
    {
        $identifier = [];

        foreach ($this->class->getIdentifier() as $name) {
            $identifier[$name] = $data[$name];
        }

        return $identifier;
    }
482172
protected function getRecipientIDs(NotificationEntity $notification)
    {
        $result = [];
        $locale = null;
        $notificationData = $notification->getNotificationData();
        $commentsRepository = $this->app->make(TranslatableCommentRepository::class);
        $someComment = false;
        // Let's notify also all the people involved in the whole discussions
        foreach (array_keys($notificationData['comments']) as $commentID) {
            $comment = $commentsRepository->find($commentID);
            if ($comment !== null) {
                $someComment = true;
                $result = array_merge($result, $this->getCommentPeopleIDs($comment->getRootComment()));
            }
        }
        if ($someComment === false) {
            throw new Exception(t('No comment found (have they been deleted?)'));
        }
        if ($notificationData['localeID'] === null) {
            // Discussions about source strings (not locale specific): let's notify the global administrators
            $ul = new UserList();
            $ul->disableAutomaticSorting();
            $ul->filterByGroup($this->getGroupsHelper()->getGlobalAdministrators());
            $ul->filterByAttribute('notify_translatable_messages', 1);
            $result = array_merge($result, $ul->getResultIDs());
        } else {
            // Locale-specific discussions: let's notify the people involved in that locale
            $locale = $this->app->make(LocaleRepository::class)->findApproved($notificationData['localeID']);
            if ($locale === null) {
                throw new Exception(t('Unable to find the locale with ID %s', $notificationData['localeID']));
            }
            $ul = new UserList();
            $ul->disableAutomaticSorting();
            $ul->filterByGroup($this->getGroupsHelper()->getTranslators($locale));
            $ul->filterByAttribute('notify_translatable_messages', 1);
            $result = array_merge($result, $ul->getResultIDs());
            $ul = new UserList();
            $ul->disableAutomaticSorting();
            $ul->filterByGroup($this->getGroupsHelper()->getAdministrators($locale));
            $ul->filterByAttribute('notify_translatable_messages', 1);
            $result = array_merge($result, $ul->getResultIDs());
        }

        return $result;
    }