Gets the delivery address of the person according to the id passed as parameter

@param $personId
@return string
@throws \GuzzleHttp\Exception\GuzzleException
160107
public function deliveryAddresses($personId)
    {
        $deliveryAddresses = $this->execute(
            self::HTTP_GET,
            self::DOMUSERP_API_PEDIDOVENDA . '/pessoas/' . $personId . '/enderecosentrega'
        );

        return $deliveryAddresses;
    }
92491
public function get(string $userId, string $emailId, array $options = []): ?\Google_Service_Gmail_Message
    {
        try {
            return $this->googleServices->getGoogleServiceGmailForUserId($userId)->users_messages->get($userId, $emailId, $options);
        } catch (\Google_Service_Exception $exception) {
            // message does not exist
            if (404 === $exception->getCode()) {
                return null;
            } else {
                throw $exception;
            }
        }
    }
839038
public static function getById($uid)
    {    
		if ($uid == USER_ANONYMOUS) return new User\Anonymous();
        $fields = self::getDbConnection()->fetchAssoc( 'SELECT * FROM '.User::TABLE.' WHERE id = ?', array( $uid ) );
        if (!$fields) throw new \Exception('User:'.$uid.' is not found'); 
        return self::fetch($fields);    
  	}
1199049
public function getOrder($orderId)
    {
        $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json';

        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $getOrderResponse = new GetOrderResponse($decodedResponseBody);
        return $getOrderResponse->getOrder();
    }
563318
public function getHeader( $uid = '' )
	{
		$view = $this->getObject()->addData( $this->getView() );

		$content = '';
		foreach( $this->getSubClients() as $subclient ) {
			$content .= $subclient->setView( $view )->getHeader( $uid );
		}
		$view->deliveryHeader = $content;


		$addr = $view->extAddressItem;

		$msg = $view->mail();
		$msg->addHeader( 'X-MailGenerator', 'Aimeos' );
		$msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() );

		$addresses = $view->extOrderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT );

		if( ( $billAddr = current( $addresses ) ) !== false && $billAddr->getEMail() != $addr->getEmail() ) {
			$msg->addCc( $billAddr->getEMail(), $billAddr->getFirstName() . ' ' . $billAddr->getLastName() );
		}

		/** client/html/email/from-name
		 * Name used when sending e-mails
		 *
		 * The name of the person or e-mail account that is used for sending all
		 * shop related emails to customers.
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/delivery/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		$fromName = $view->config( 'client/html/email/from-name' );

		/** client/html/email/delivery/from-name
		 * Name used when sending delivery e-mails
		 *
		 * The name of the person or e-mail account that is used for sending all
		 * shop related delivery e-mails to customers. This configuration option
		 * overwrites the name set in "client/html/email/from-name".
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		$fromNameDelivery = $view->config( 'client/html/email/delivery/from-name', $fromName );

		/** client/html/email/from-email
		 * E-Mail address used when sending e-mails
		 *
		 * The e-mail address of the person or account that is used for sending
		 * all shop related emails to customers.
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/from-name
		 * @see client/html/email/delivery/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		$fromEmail = $view->config( 'client/html/email/from-email' );

		/** client/html/email/delivery/from-email
		 * E-Mail address used when sending delivery e-mails
		 *
		 * The e-mail address of the person or account that is used for sending
		 * all shop related delivery emails to customers. This configuration option
		 * overwrites the e-mail address set via "client/html/email/from-email".
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/delivery/from-name
		 * @see client/html/email/from-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $fromEmailDelivery = $view->config( 'client/html/email/delivery/from-email', $fromEmail ) ) != null ) {
			$msg->addFrom( $fromEmailDelivery, $fromNameDelivery );
		}


		/** client/html/email/reply-name
		 * Recipient name displayed when the customer replies to e-mails
		 *
		 * The name of the person or e-mail account the customer should
		 * reply to in case of questions or problems. If no reply name is
		 * configured, the name person or e-mail account set via
		 * "client/html/email/from-name" is used.
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/reply-email
		 * @see client/html/email/delivery/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/from-name
		 * @see client/html/email/bcc-email
		 */
		$replyName = $view->config( 'client/html/email/reply-name', $fromName );

		/** client/html/email/delivery/reply-name
		 * Recipient name displayed when the customer replies to delivery e-mails
		 *
		 * The name of the person or e-mail account the customer should
		 * reply to in case of questions or problems. This configuration option
		 * overwrites the name set via "client/html/email/reply-name".
		 *
		 * @param string Name shown in the e-mail
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/delivery/reply-email
		 * @see client/html/email/reply-name
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		$replyNameDelivery = $view->config( 'client/html/email/delivery/reply-name', $replyName );

		/** client/html/email/reply-email
		 * E-Mail address used by the customer when replying to e-mails
		 *
		 * The e-mail address of the person or e-mail account the customer
		 * should reply to in case of questions or problems.
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/reply-name
		 * @see client/html/email/delivery/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		$replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail );

		/** client/html/email/delivery/reply-email
		 * E-Mail address used by the customer when replying to delivery e-mails
		 *
		 * The e-mail address of the person or e-mail account the customer
		 * should reply to in case of questions or problems. This configuration
		 * option overwrites the e-mail address set via "client/html/email/reply-email".
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @see client/html/email/delivery/reply-name
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 * @see client/html/email/bcc-email
		 */
		if( ( $replyEmailDelivery = $view->config( 'client/html/email/delivery/reply-email', $replyEmail ) ) != null ) {
			$msg->addReplyTo( $replyEmailDelivery, $replyNameDelivery );
		}


		/** client/html/email/bcc-email
		 * E-Mail address all e-mails should be also sent to
		 *
		 * Using this option you can send a copy of all shop related e-mails to
		 * a second e-mail account. This can be handy for testing and checking
		 * the e-mails sent to customers.
		 *
		 * It also allows shop owners with a very small volume of orders to be
		 * notified about new orders. Be aware that this isn't useful if the
		 * order volumne is high or has peeks!
		 *
		 * @param string E-mail address
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see client/html/email/delivery/bcc-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 */
		$bccEmail = $view->config( 'client/html/email/bcc-email' );

		/** client/html/email/delivery/bcc-email
		 * E-Mail address all delivery e-mails should be also sent to
		 *
		 * Using this option you can send a copy of all delivery related e-mails
		 * to a second e-mail account. This can be handy for testing and checking
		 * the e-mails sent to customers.
		 *
		 * It also allows shop owners with a very small volume of orders to be
		 * notified about new orders. Be aware that this isn't useful if the
		 * order volumne is high or has peeks!
		 *
		 * This configuration option overwrites the e-mail address set via
		 * "client/html/email/bcc-email".
		 *
		 * @param string|array E-mail address or list of e-mail addresses
		 * @since 2014.03
		 * @category User
		 * @category Developer
		 * @see client/html/email/bcc-email
		 * @see client/html/email/reply-email
		 * @see client/html/email/from-email
		 */
		if( ( $bccEmailDelivery = $view->config( 'client/html/email/delivery/bcc-email', $bccEmail ) ) != null )
		{
			foreach( (array) $bccEmailDelivery as $emailAddr ) {
				$msg->addBcc( $emailAddr );
			}
		}


		/** client/html/email/delivery/standard/template-header
		 * Relative path to the text header template of the email delivery client.
		 *
		 * The template file contains the text and processing instructions
		 * to generate the text that is inserted into the header
		 * of the e-mail. The configuration string is the
		 * path to the template file relative to the templates directory (usually
		 * in client/html/templates).
		 *
		 * You can overwrite the template file configuration in extensions and
		 * provide alternative templates. These alternative templates should be
		 * named like the default one but with the string "standard" replaced by
		 * an unique name. You may use the name of your project for this. If
		 * you've implemented an alternative client class as well, "standard"
		 * should be replaced by the name of the new class.
		 *
		 * The email payment text client allows to use a different template for
		 * each payment status value. You can create a template for each payment
		 * status and store it in the "email/payment/<status number>/" directory
		 * below the "templates" directory (usually in client/html/templates). If no
		 * specific layout template is found, the common template in the
		 * "email/payment/" directory is used.
		 *
		 * @param string Relative path to the template creating code for the e-mail header
		 * @since 2014.03
		 * @category Developer
		 * @see client/html/email/delivery/standard/template-body
		 */
		$tplconf = 'client/html/email/delivery/standard/template-header';

		$status = $view->extOrderItem->getDeliveryStatus();
		$default = array( 'email/delivery/' . $status . '/header-standard', 'email/delivery/header-standard' );

		return $view->render( $view->config( $tplconf, $default ) ); ;
	}
543524
public function get_user($userid) {
        global $DB;

        if (empty(self::$cachedusers[$userid])) {
            $fields = get_all_user_name_fields(true);
            self::$cachedusers[$userid] = $DB->get_record('user', array('id' => $userid), 'id, ' . $fields);
        }
        return self::$cachedusers[$userid];
    }
1213739
public function getOrder($orderId)
    {
        if (strrpos(str_replace('\\', '/', DIR_APPLICATION), '/catalog/') === strlen(DIR_APPLICATION) - strlen('/catalog/')) {
            // We are in the catalog section, use the checkout/order model as
            // ModelAccountOrder::getOrder() also checks on user_id!
            if ($this->model_checkout_order === null) {
                $this->load->model('checkout/order');
            }
            return $this->model_checkout_order->getOrder($orderId);
        } else {
            // We are in the admin section, we can use the normal order model.
            return $this->getOrderModel()->getOrder($orderId);
        }
    }
324857
public function userinfo($userid){
       try{
           if (empty($userId))
               throw new Exception('Paramer "userId" is required');

           $params = array (
               'userId' => $userId,
           );

           $ret = $this->SendRequest->curl('/user/info.json',$params,'urlencoded','im','POST');
           if(empty($ret))
               throw new Exception('bad request');
           return $ret;

       }catch (Exception $e) {
           print_r($e->getMessage());
       }
   }
1024004
public function getDeliveryExecutionId($aliasId)
    {
        $queryBuilder = $this->getQueryBuilder();
        $queryBuilder->select(self::DELIVERY_EXECUTION_ID);
        $queryBuilder->where('t.'.self::RESULT_ID . '=?');
        $queryBuilder->setParameters([$aliasId]);
        $stmt = $this->persistence->query($queryBuilder->getSQL(), $queryBuilder->getParameters());
        $data = $stmt->fetch(\PDO::FETCH_ASSOC);
        return isset($data[self::DELIVERY_EXECUTION_ID])
            ? $data[self::DELIVERY_EXECUTION_ID]
            : $aliasId;
    }
292789
public function getByTrackingId($id) {
    	// Request syntax needed to track by tracking id
    	$this->request['SelectionDetails'] = array(
			'PackageIdentifier' => array(
				'Type' => 'TRACKING_NUMBER_OR_DOORTAG',
				'Value' => $id // Tracking ID to track
			)
		);

    	$req = $this->buildRequest($this->request);

    	return $this->getSoapClient()->track($req);;

    }
766680
public function clientGetByUid($uid)
  {
    foreach($this->clientList() as $client)
    {
      if($client["client_unique_identifier"] == $uid) return $client;
    }

    throw new Exception("invalid clientID", 0x200);
  }
1052960
public function getIdCardPath($userId)
    {
        $avatarPath = $this->getSetting('idCardPath') . '/' . $this->getIdSavePath($userId);
        if (!is_dir($avatarPath)) {
            FileHelper::createDirectory($avatarPath);
        }
        return $avatarPath . substr($userId, -2);
    }
1237868
public function getRichMenuId($userId)
    {
        $url = sprintf('%s/v2/bot/user/%s/richmenu', $this->endpointBase, urlencode($userId));
        return $this->httpClient->get($url, []);
    }
452850
public function getUser($userId)
    {
        // Check if we've already retrieved this user.
        if (isset($this->userEntities[$userId])) {
            return $this->userEntities[$userId];
        }

        $query = $this->getUserQuery($userId);
        /** @var Entity\Users $userEntity */
        if ($userEntity = $this->findOneWith($query)) {
            $this->unsetSensitiveFields($userEntity);
        }

        // Remember the user
        $this->userEntities[$userId] = $userEntity;

        return $userEntity;
    }
678114
public static function getUser($userId)
    {
        /** @var \tao_models_classes_UserService $userService */
        $userService = ServiceManager::getServiceManager()->get(\tao_models_classes_UserService::SERVICE_ID);
        $user = $userService->getUserById($userId);
        return $user;
    }
1170241
protected function getCustomerAddress()
    {
        $deliveryAddress = null;
        $addressId = $this->getSession()->getOrder()->getChoosenDeliveryAddress();
        if (null === $addressId) {
            $customer = $this->getSecurityContext()->getCustomerUser();

            $deliveryAddress = AddressQuery::create()
                ->filterByCustomerId($customer->getId())
                ->orderByIsDefault(Criteria::DESC)
                ->findOne();

            if (null !== $deliveryAddress) {
                $this->getSession()->getOrder()->setChoosenDeliveryAddress(
                    $deliveryAddress->getId()
                );
            }
        } else {
            $deliveryAddress = AddressQuery::create()->findPk($addressId);
        }

        return $deliveryAddress;
    }
1069205
public function getDeliveryThemeIdFromCache($deliveryId)
    {
        $cache    = $this->getCache();
        $cacheKey = $this->getCacheKey($deliveryId);
        if ($cache->has($cacheKey)) {
            return $cache->get($cacheKey);
        }

        return false;
    }