Return an array of user recipients for the given monitorName

@param string $monitorName
@return array
4841
protected function _getUserTo($monitorName)
    {
        switch ($monitorName) {
            case 'maintenancemode':
                $roles = $this->util->getDbLookup()->getRolesByPrivilege('pr.maintenance.maintenance-mode');
                if ($roles) {
                    $joins = "JOIN gems__groups ON gsf_id_primary_group = ggp_id_group 
                      JOIN gems__roles ON ggp_role = grl_id_role";

                    $where = 'grl_name IN (' .
                            implode(', ', array_map(array($this->db, 'quote'), array_keys($roles))) .
                            ')';
                } else {
                    return [];
                }
                break;

            case 'cronmail':
            default:
                $joins = '';
                $where = 'gsf_mail_watcher = 1';
                break;
        }
        
        $userTo = $this->db->fetchCol(
                "SELECT DISTINCT gsf_email FROM gems__staff $joins WHERE LENGTH(gsf_email) > 5 AND gsf_active = 1 AND $where"
                );
        return $userTo;
    }
1204189
public function get($indexName)
	{
		$index = $this->getRegistered($indexName);

		$params = [
			'index' => $index->getInternalName()
		];

		return $this->elasticSearcher->getClient()->indices()->getMapping($params);
	}
293270
public function removeUserAsCollaborator(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/collaborators/:username',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $username),
            Request::METHOD_DELETE);
    }
150065
public function getMessagesFor(string $fieldName) : array
    {
        $invalidInputException = $this->getInvalidInputExceptionFor($fieldName);

        if ($invalidInputException) {
            return $invalidInputException->getMessages();
        }

        $invalidFormSubmission = $this->getInnerFormSubmissionExceptionFor($fieldName);

        if ($invalidFormSubmission) {
            return $invalidFormSubmission->getFieldMessageMap();
        }

        return [];
    }
525892
public function forUser($username)
    {
        $options = [
            'username' => $username,
            'field_set_key' => 'detailed',
        ];

        $result = $this->get(UrlBuilder::RESOURCE_GET_BOARDS, $options);

        return $result ?: [];
    }
827954
public function getIndexes($tableName)
    {
        $indexes = [];
        $sql = "SELECT I.[name] AS [index_name], I.[index_id] as [index_id], T.[object_id] as [table_id]
FROM sys.[tables] AS T
  INNER JOIN sys.[indexes] I ON T.[object_id] = I.[object_id]
WHERE T.[is_ms_shipped] = 0 AND I.[type_desc] <> 'HEAP'  AND T.[name] = '{$tableName}'
ORDER BY T.[name], I.[index_id];";

        $rows = $this->fetchAll($sql);
        foreach ($rows as $row) {
            $columns = $this->getIndexColums($row['table_id'], $row['index_id']);
            $indexes[$row['index_name']] = ['columns' => $columns];
        }

        return $indexes;
    }
183281
public function getBcc()
    {
        $recipients = [];
        foreach ($this->message->getBcc() as $email => $name) {
            $recipients[] = new Email($email, $name);
        }

        return $recipients;
    }
806985
public function get($indexOrName)
    {
        if (isset($this->arrayVar[$indexOrName])) {
            return $this->arrayVar[$indexOrName];
        }
        return false;
    }
180880
public function getSingleUser(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username', $username));
    }
952644
public function getListeners($eventName)
    {
        $listeners = isset($this->listeners[$eventName]) ? $this->listeners[$eventName] : [];

        $listeners = array_merge(
            $listeners,
            $this->getWildcardListeners($eventName)
        );

        return class_exists($eventName, false)
            ? $this->addInterfaceListeners($eventName, $listeners)
            : $listeners;
    }
153927
public function getListeners($eventName = null)
    {

        if (empty($eventName)) return $this->listeners;
        if (!empty($eventName) && !isset($this->listeners[$eventName])) return [];

        return $this->listeners[$eventName];
    }
1345366
public function getUserDetails($username)
	{
		// load username from email
		if (strpos($username, '@'))
		{
			$username = $this->getUsernameFromEmail($username);
		}

		// load profile object, make sure its valid
		$profile = \Hubzero\User\User::oneByUsername($username);

		if (!$profile->get('id'))
		{
			return false;
		}

		// return details as associative array
		return ['user_id' => $profile->get('id'), 'scope' => null];
	}
1306154
public function receivers($signalName)
    {

        $this->getSignal($signalName);

        $receivers = [];

        foreach ($this->receivers as $id=>$receiver) {
            if ($receiver->getSignalName() == $signalName) {
                $receivers[] = $receiver;
            }
        }

        return $receivers;

    }
644430
public function listSubscriptions(string $username = null): array
    {
        if (null !== $username) {
            return $this->getApi()->request($this->getApi()->sprintf('/users/:username/subscriptions',
                $this->getActivity()->getOwner(), $this->getActivity()->getRepo(), $username));
        }

        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/user/subscriptions', $this->getActivity()->getOwner(),
                                                 $this->getActivity()->getRepo()));
    }
778066
public static function findByUsername($username, $checkStatus = true)
    {
        return static::findOne(
            $checkStatus ?
                ['username' => $username, 'status' => self::STATUS_ACTIVE] :
                ['username' => $username]
        );
    }
1114506
def _get_recipients(self, array):
        
        for address, name in array:
            if not name:
                yield address
            else:
                yield "\"%s\" <%s>" % (name, address)
434663
protected function UserGroupDelete($groupName)
    {
        $return = [];
        $id = $this->UserGetGroupIdByCode($groupName);
        if ($id) {
            $group = new CGroup();
            if ($group->Delete($id)) {
                $return[] = "Delete group {$groupName}";
            } else {
                throw new Exception("Can't delete group {$groupName}");
            }
        } else {
            throw new Exception("Group {$groupName} does not exist");
        }

        return $return;
    }