gets the records the user selected in the single address selection field

@return array Array of addresses with their uids as array keys
519205
public function getSingleRecords()
    {
        $singleRecords = [];
        $singleRecordUids = GeneralUtility::intExplode(',', $this->conf['singleSelection'], true);
        $pids = GeneralUtility::intExplode(',', $this->conf['pidList'], true);

        if (!empty($singleRecordUids)) {
            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_address');
            $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
            $queryBuilder
                ->select('*')
                ->from('tt_address')
                ->where(
                    $queryBuilder->expr()->in('uid', $singleRecordUids)
                );

            if (!empty($pids)) {
                $queryBuilder->andWhere($queryBuilder->expr()->in('pid', $pids));
            }

            $result = $queryBuilder->execute();
            while ($address = $result->fetch()) {
                $singleRecords[$address['uid']] = $this->getGroupsForAddress($address);
            }
        }
        return $singleRecords;
    }
705092
public function getUsersList() {
        $response=CodeBank_ClientAPI::responseBase();
        
        $members=Permission::get_members_by_permission(array('ADMIN', 'CODE_BANK_ACCESS'));
        foreach($members as $member) {
            $response['data'][]=array(
                                    'id'=>$member->ID,
                                    'username'=>$member->Email,
                                    'lastLogin'=>$member->LastVisited
                                );
        }
        
        
        return $response;
    }
206204
public function get_profile_fields() {
        global $DB;
        if (!$fields = $DB->get_records('user_info_field', null, 'shortname', 'id,shortname')) {
            return null;
        }
        $res = array(0 => get_string('anyfield', 'filters'));
        foreach ($fields as $k => $v) {
            $res[$k] = $v->shortname;
        }
        return $res;
    }
1014196
protected function _getAppointmentSelect()
    {
        $select = $this->db->select();

        $select->from('gems__appointments')
                ->joinLeft( 'gems__agenda_activities', 'gap_id_activity = gaa_id_activity')
                ->joinLeft('gems__agenda_procedures',  'gap_id_procedure = gapr_id_procedure')
                ->joinLeft('gems__locations',          'gap_id_location = glo_id_location')
                ->order('gap_admission_time DESC');

        return $select;
    }
254658
public function getIds()
    {
        $ids      = array();
        $iterator = new APCUIterator('user', null, APCU_ITER_KEY);
        foreach ($iterator as $item) {
            $ids[] = $item['key'];
        }

        return $ids;
    }
455954
protected function user_emails()
    {
        $addresses = $this->rc->user->list_emails();

        foreach ($addresses as $idx => $email) {
            $addresses[$idx] = $email['email'];
        }

        $addresses = array_unique($addresses);
        sort($addresses);

        return $addresses;
    }
702236
public function getSelectedAddress()
    {
        if ($this->_oSelAddress !== null) {
            return $this->_oSelAddress;
        }

        $oSelectedAddress = null;
        $oAddresses = $this->getUserAddresses();
        if ($oAddresses->count()) {
            if ($sAddressId = $this->getSelectedAddressId()) {
                foreach ($oAddresses as $oAddress) {
                    if ($oAddress->getId() == $sAddressId) {
                        $oAddress->selected = 1;
                        $oAddress->setSelected();
                        $oSelectedAddress = $oAddress;
                        break;
                    }
                }
            }

            // in case none is set - setting first one
            if (!$oSelectedAddress) {
                if (!$sAddressId || $sAddressId >= 0) {
                    $oAddresses->rewind();
                    $oAddress = $oAddresses->current();
                } else {
                    $aAddresses = $oAddresses->getArray();
                    $oAddress = array_pop($aAddresses);
                }
                $oAddress->selected = 1;
                $oAddress->setSelected();
                $oSelectedAddress = $oAddress;
            }
        }
        $this->_oSelAddress = $oSelectedAddress;

        return $oSelectedAddress;
    }
306847
public function apply()
    {
        $records = $this->getRecordsIncludingArchived();
        
        if ($ids = $this->getStagedIds()) {
            $records = $records->exclude('ID', $ids);
        }
        
        return $records;
    }
1014181
public function getRequestParameters()
    {
        $aViewVariables = array();

        $aTmp = $this->GetAllInputFieldParameter();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }
        $aTmp = $this->GetUserAddressData();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }
        $aTmp = $this->GetPaymentTypeSpecifivParameter();
        foreach (array_keys($aTmp) as $sTmpKey) {
            $aViewVariables[$sTmpKey] = $aTmp[$sTmpKey];
        }

        return $aViewVariables;
    }
957998
protected function GetUserAddressData()
    {
        $aUserAddressData = parent::GetUserAddressData();
        $oActiveUser = TdbDataExtranetUser::GetInstance();
        if ($oActiveUser) {
            $oBillingAddress = $oActiveUser->GetBillingAddress();
            if ($oBillingAddress) {
                $aUserAddressData['addr_name'] = $oBillingAddress->fieldFirstname.' '.$oBillingAddress->fieldLastname;
            }
        }

        return $aUserAddressData;
    }
471384
public function getAddress() : ?array
     {
        $rtn = $this->data['address'];

        $rtn = json_decode($rtn, true);

        if ($rtn === false) {
            $rtn = null;
        }

        return $rtn;
     }
663721
public function getLocalAccounts()
    {
        if (!is_null($this->localAccountCache)) {
            return $this->localAccountCache;
        }

        return $this->localAccountCache = array_map('strtolower',
            $this->db->get_col("SELECT user_login FROM " . $this->db->users . " ORDER BY RAND()"));
    }
390268
public function getRevCardGet()
    {
        $array = array();
        if (isset($this->_receive['CardId'])) {
            $array['CardId'] = $this->_receive['CardId'];
        }
        if (isset($this->_receive['IsGiveByFriend'])) {
            $array['IsGiveByFriend'] = $this->_receive['IsGiveByFriend'];
        }
        $array['OldUserCardCode'] = $this->_receive['OldUserCardCode'];
        if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) {
            $array['UserCardCode'] = $this->_receive['UserCardCode'];
        }
        return (isset($array) && count($array) > 0) ? $array : false;
    }
43980
public function getAddresses()
    {
        $accountAddresses = $this->entity->getAccountAddresses();
        $addresses = [];

        if (!is_null($accountAddresses)) {
            /** @var ContactAddress $accountAddress */
            foreach ($accountAddresses as $accountAddress) {
                $address = $accountAddress->getAddress();
                $address->setPrimaryAddress($accountAddress->getMain());
                $addresses[] = new Address($address, $this->locale);
            }
        }

        return $addresses;
    }
901796
public function getUsersPairsWithGroupNamesForSelects()
    {
        // Check and init cache
        if (!self::$cached_users_pairs_with_groups) {
            $user_collection = new AdminUserRepository;
            $user_collection->addOrderByField('name');
            foreach ($user_collection->getAsArrayOfObjects() as $v) {
                /** @var AdminUser $v */

                $group = new AdminUserGroup($v->getGroupId());
                self::$cached_users_pairs_with_groups[$group->getTitle()][$v->getId()] = $v->getName() . ' ' . $v->getSurname() . ' [' . $v->getLogin() . ']';
            }
        }

        return self::$cached_users_pairs_with_groups;
    }
1148603
public function get_requester() {
        global $DB;
        static $requesters= array();
        if (!array_key_exists($this->properties->requester, $requesters)) {
            $requesters[$this->properties->requester] = $DB->get_record('user', array('id'=>$this->properties->requester));
        }
        return $requesters[$this->properties->requester];
    }
816433
public function GetApplicants() {
      $ApplicantRoleID = (int)C('Garden.Registration.ApplicantRoleID', 0);
      if ($ApplicantRoleID == 0)
         return new Gdn_DataSet();

      return $this->SQL->Select('u.*')
         ->From('User u')
         ->Join('UserRole ur', 'u.UserID = ur.UserID')
         ->Where('ur.RoleID', $ApplicantRoleID, TRUE, FALSE)
//         ->GroupBy('UserID')
         ->OrderBy('DateInserted', 'desc')
         ->Get();
   }