Returns user defined Address list object

@param string $sUserId object ID (default is null)

@return array
167743
public function getUserAddresses($sUserId = null)
    {
        $sUserId = isset($sUserId) ? $sUserId : $this->getId();
        if (!isset($this->_aAddresses[$sUserId])) {
            $oUserAddressList = oxNew(\OxidEsales\Eshop\Application\Model\UserAddressList::class);
            $oUserAddressList->load($sUserId);
            $this->_aAddresses[$sUserId] = $oUserAddressList;

            // marking selected
            if ($sAddressId = $this->getSelectedAddressId()) {
                foreach ($this->_aAddresses[$sUserId] as $oAddress) {
                    if ($oAddress->getId() === $sAddressId) {
                        $oAddress->setSelected();
                        break;
                    }
                }
            }
        }

        return $this->_aAddresses[$sUserId];
    }
647380
public function getLastUserPaymentType($sUserId)
    {
        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        $sQ = 'select oxorder.oxpaymenttype from oxorder where oxorder.oxshopid="' . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . '" and oxorder.oxuserid=' . $masterDb->quote($sUserId) . ' order by oxorder.oxorderdate desc ';
        $sLastPaymentId = $masterDb->getOne($sQ);

        return $sLastPaymentId;
    }
483419
public function getSystemUserArray()
    {
        $repo = $this->get('sulu_security.user_repository');
        $users = $repo->getUserInSystem();
        $contacts = [];

        foreach ($users as $user) {
            $contact = $user->getContact();
            $contacts[] = array(
                'id' => $contact->getId(),
                'fullName' => $contact->getFullName()
            );
        }
        return $contacts;
    }
395869
public function listAction($userId)
    {
        $userManager = $this->get('phlexible_user.user_manager');
        $systemUid = $userManager->getSystemUserId();

        $skipUserIds = [$userId];
        if (!in_array($systemUid, $skipUserIds)) {
            $skipUserIds[] = $systemUid;
        }

        $users = [];
        foreach ($userManager->findAll() as $user) {
            if (in_array($user->getId(), $skipUserIds)) {
                continue;
            }

            $users[$user->getDisplayName()] = [
                'uid' => $user->getId(),
                'name' => $user->getDisplayName(),
            ];
        }

        ksort($users);
        $users = array_values($users);

        return new JsonResponse($users);
    }
927106
public function getAccessTokenList($userId)
    {
        self::requireSession();
        if (false === \array_key_exists(\sprintf('_oauth2_token_%s', $userId), $_SESSION)) {
            return [];
        }

        return $_SESSION[\sprintf('_oauth2_token_%s', $userId)];
    }
1146588
public function load($sUserId)
    {
        $sViewName = getViewName('oxcountry');
        $oBaseObject = $this->getBaseObject();
        $sSelectFields = $oBaseObject->getSelectFields();

        $sSelect = "
                SELECT {$sSelectFields}, `oxcountry`.`oxtitle` AS oxcountry
                FROM oxaddress
                LEFT JOIN {$sViewName} AS oxcountry ON oxaddress.oxcountryid = oxcountry.oxid
                WHERE oxaddress.oxuserid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sUserId);
        $this->selectString($sSelect);
    }
766239
public function createReference($userId)
    {
        $myUserId = $userId;
        if(is_array($userId) && array_key_exists('id', $userId)){
            $myUserId = $userId['id'];
        }
        return 'SU:' . $myUserId;
    }
1056551
public function get_from_user_id_and_post_ids(int $userid, array $postids) {
        $alias = $this->get_table_alias();
        [$postidinsql, $params] = $this->get_db()->get_in_or_equal($postids);
        $params[] = $userid;

        $wheresql = "{$alias}.postid {$postidinsql}";
        $wheresql .= " AND {$alias}.userid = ?";
        $sql = $this->generate_get_records_sql($wheresql);
        $records = $this->get_db()->get_records_sql($sql, $params);

        return $this->transform_db_records_to_entities($records);
    }
904764
public function getUserTypeEntities($entityId = false) {
        if (!empty($entityId)) {
            $filter = is_array($entityId) ? $entityId : array(
                'ENTITY_ID' => $entityId
            );
        } else {
            $filter = array();
        }


        /** @noinspection PhpDynamicAsStaticMethodCallInspection */
        $dbres = \CUserTypeEntity::GetList(array(), $filter);
        $result = array();
        while ($item = $dbres->Fetch()) {
            $result[] = $this->getUserTypeEntityById($item['ID']);

        }
        return $result;
    }
1069571
public function getSelectedAddressId()
    {
        if ($this->_sSelAddressId !== null) {
            return $this->_sSelAddressId;
        }

        $sAddressId = Registry::getConfig()->getRequestParameter("oxaddressid");
        if (!$sAddressId && !Registry::getConfig()->getRequestParameter('reloadaddress')) {
            $sAddressId = Registry::getSession()->getVariable("deladrid");
        }

        return $sAddressId;
    }
28351
public function listRepositories($userId = null)
    {
        $parameters = [];
        if ($userId) {
            $parameters['user_id'] = $userId;
        }

        return $this->get('/installation/repositories', $parameters);
    }
1268212
public function index()
    {
        return view('address.list', [
            'addresses' => $addresses = Auth::user()->addresses,
            'defaultId' => $addresses->where('default', true)->pluck('id')->first(),
        ]);
    }
281364
public function index($locationId)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $location = Location::findOrFail($locationId);
        $this->authorize('view', $location);
        return $this->respondRelatedAddresses($locationId, 'location');
    }
219347
protected function getListAddress()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->address->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('user')) {
            return $this->address->getList(array('user_id' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $result = $this->address->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
1007543
public function getAddresses($type = ShopgateAddress::BOTH)
    {
        if (empty($this->addresses)) {
            return array();
        }

        $addresses = array();

        foreach ($this->addresses as $address) {
            if (($address->getAddressType() & $type) == $address->getAddressType()) {
                $addresses[] = $address;
            }
        }

        return $addresses;
    }
290607
public function index($userId)
    {
        $user = User::with('addresses')
            ->findOrFail($userId);
        $this->authorize('view', $user);
        return fractal($user->addresses, new AddressTransformer())
            ->withResourceName('userAddress')
            ->respond();
    }
847815
static function fetchListForUser( $userID, $offset = false, $limit = false )
    {
        $objectList = eZPersistentObject::fetchObjectList( eZContentBrowseBookmark::definition(),
                                                            null,
                                                            array( 'user_id' => $userID ),
                                                            array( 'id' => 'desc' ),
                                                            array( 'offset' => $offset, 'length' => $limit ),
                                                            true );
        return $objectList;
    }