@param $upaID

@return UserPointAction
512929
public static function getByID($upaID)
    {
        $db = Database::connection();
        $row = $db->getRow("SELECT * FROM UserPointActions WHERE upaID = ?", array($upaID));
        if ($row['upaID']) {
            $upa = static::getClass($row);
            $upa->setDataFromArray($row);

            return $upa;
        }
    }
1244956
public function updateUser(User $user, UserUpdater $up)
    {
        $up->updateUser($user, $this->getEncoder());
        $em = $this->getRegistry()->getManager();
        $em->persist($user);
        $em->flush();
    }
778013
public static function Walk($callback, $userData = null) {
		self::start ();
		array_walk ( $_SESSION, $callback, $userData );
		return $_SESSION;
	}
909472
@Bean(name = "uPortalAccountUserSource")
    @Qualifier("uPortalInternal")
    public IPersonAttributeDao getUPortalAccountUserSource() {
        final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao();
        rslt.setLocalAccountDao(localAccountDao);
        rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());

        final Map<String, String> queryAttributeMapping = new HashMap<>();
        queryAttributeMapping.put(USERNAME_ATTRIBUTE, USERNAME_ATTRIBUTE);
        queryAttributeMapping.put(GIVEN_NAME_ATTRIBUTE, GIVEN_NAME_ATTRIBUTE);
        queryAttributeMapping.put(SIR_NAME_ATTRIBUTE, SIR_NAME_ATTRIBUTE);
        rslt.setQueryAttributeMapping(queryAttributeMapping);

        final Map<String, Set<String>> resultAttributeMapping = new HashMap<>();
        resultAttributeMapping.put(
                USERNAME_ATTRIBUTE,
                Stream.of(USERNAME_ATTRIBUTE, UID_ATTRIBUTE, USER_LOGIN_ID_ATTRIBUTE)
                        .collect(Collectors.toSet()));
        rslt.setResultAttributeMapping(resultAttributeMapping);

        return rslt;
    }
925649
protected function _actionXpayment($context)
    {
        $data = $context->data;
        $package = $this->getItem();
        $gateway = $this->getService('com:subscriptions.controller.subscription')->getGateway();

        try {

            $payload = $this->order->getPayload();
            $confirm = route('option=com_subscriptions&view=signup&action=confirm&xpayment=true&id='.$package->id, true);
            $cancel = route('option=com_subscriptions&view=signup&action=cancel&xpayment=true&id='.$package->id, true);
            $url = $gateway->getAuthorizationURL($payload, $confirm, $cancel);
            $context->response->setRedirect($url, AnHttpResponse::SEE_OTHER);

        } catch (Exception $error) {
            throw new RuntimeException($error->getMessage());
        }
    }
220604
public static function createSellReturn($id, $userContact, $taxSystem, $paymentAddress=null)
    {
        return new static($id, $userContact, static::INTENT_SELL_RETURN, $taxSystem,
                          $paymentAddress);
    }
156103
public function filter($userAgent, $deviceID)
    {
        if ($this->canHandle($userAgent)) {
            $this->updateUserAgentsWithDeviceIDMap($userAgent, $deviceID);
            return null;
        }
        if (isset($this->nextHandler)) {
            return $this->nextHandler->filter($userAgent, $deviceID);
        }
        return null;
    }
170477
public function getUserRole($userAccount)
    {
        $request = new GetUserRoleRequest($this->groupId, $userAccount);
        $response = new GetUserRoleResponse();
        return $this->client->sendRequest($request, $response);
    }
771865
public function podiumThumb($up = true, $count = 0)
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            $loggedId = User::loggedId();
            if ($this->thumb) {
                if ($this->thumb->thumb == 1 && !$up) {
                    $this->thumb->thumb = -1;
                    if (!$this->thumb->save()) {
                        throw new Exception('Thumb saving error!');
                    }
                    if (!$this->updateCounters(['likes' => -1, 'dislikes' => 1])) {
                        throw new Exception('Thumb counters saving error!');
                    }
                } elseif ($this->thumb->thumb == -1 && $up) {
                    $this->thumb->thumb = 1;
                    if (!$this->thumb->save()) {
                        throw new Exception('Thumb saving error!');
                    }
                    if (!$this->updateCounters(['likes' => 1, 'dislikes' => -1])) {
                        throw new Exception('Thumb counters saving error!');
                    }
                }
            } else {
                $postThumb = new PostThumb();
                $postThumb->post_id = $this->id;
                $postThumb->user_id = $loggedId;
                $postThumb->thumb = $up ? 1 : -1;
                if (!$postThumb->save()) {
                    throw new Exception('PostThumb saving error!');
                }
                if ($postThumb->thumb) {
                    if (!$this->updateCounters(['likes' => 1])) {
                        throw new Exception('Thumb counters saving error!');
                    }
                } else {
                    if (!$this->updateCounters(['dislikes' => 1])) {
                        throw new Exception('Thumb counters saving error!');
                    }
                }
            }
            if ($count == 0) {
                Podium::getInstance()->podiumCache->set('user.votes.' . $loggedId, ['count' => 1, 'expire' => time() + 3600]);
            } else {
                Podium::getInstance()->podiumCache->setElement('user.votes.' . $loggedId, 'count', $count + 1);
            }
            $transaction->commit();
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), null, __METHOD__);
        }
        return false;
    }
1124112
protected static function _GivePoints($UserID, $Points, $SlotType, $Source = 'Total', $CategoryID = 0, $Timestamp = FALSE) {
      $TimeSlot = gmdate('Y-m-d', Gdn_Statistics::TimeSlotStamp($SlotType, $Timestamp));
      
      $Px = Gdn::Database()->DatabasePrefix;
      $Sql = "insert {$Px}UserPoints (UserID, SlotType, TimeSlot, Source, CategoryID, Points)
         values (:UserID, :SlotType, :TimeSlot, :Source, :CategoryID, :Points)
         on duplicate key update Points = Points + :Points1";
      
      Gdn::Database()->Query($Sql, array(
          ':UserID' => $UserID, 
          ':Points' => $Points, 
          ':SlotType' => $SlotType, 
          ':Source' => $Source,
          ':CategoryID' => $CategoryID,
          ':TimeSlot' => $TimeSlot, 
          ':Points1' => $Points));
   }
486284
public function provider(ProviderRequest $providerRequest)
    {
      // Extract SimplePay user from request
      $user = $providerRequest->getUser();

      // Create request
      $request = new StdClass();
      $request->User = new StdClass();
      $request->User->Uuid = $user->getUuid()->getValue();
      $request->User->Hash = $user->getHash();

      /*$request = new StdClass();
       $request->Auth = new StdClass();
       $request->Auth->Uuid
       $request->Auth->Method
       $request->Auth->Signature
       $request->Auth->Token
       $request->Auth->Timestamp
       $request->Auth->Nonce
       $request->Auth->Version*/

      // Check type
      if($providerRequest->hasType())
        $request->Type = $providerRequest->getType();

      // Send request
      $response = $this->getSoapClient()->provider($request);

      // Create a new ProviderResponse
      $providerResponse = new ProviderResponse();

      if(!is_array($response->Provider))
        $response->Provider = array($response->Provider);

      foreach($response->Provider as $provider)
      {
        // Extract values from reponse
        $uuid = $provider->Uuid;
        $name = $provider->Name;
        $type = $provider->Type;

        $uuid = new Uuid($uuid);

        // Create a new Provider
        $provider = new Provider($uuid, $name, $type);

        // Add bank to response
        $providerResponse->addProvider($provider);
      }

      return $providerResponse;
    }
273019
public function setUserAgent($userAgent = null)
        {
            if (!empty($userAgent)) {
                return $this->userAgent = $userAgent;
            } else {
                $this->userAgent = null;
                foreach($this->getUaHttpHeaders() as $altHeader) {
                    if(!empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban)
                        $this->userAgent .= $this->httpHeaders[$altHeader] . " ";
                    }
                }
                return $this->userAgent = (!empty($this->userAgent) ? trim($this->userAgent) : null);
            }
        }
785167
public function createLinkToken($userId)
    {
        $url = sprintf('%s/v2/bot/user/%s/linkToken', $this->endpointBase, urlencode($userId));
        return $this->httpClient->post($url, []);
    }
800810
public function update(UserUpdateRequest $request)
    {
        try {
            if ($this->service->update(auth()->id(), $request->all())) {
                return back()->with('message', 'Settings updated successfully');
            }

            return back()->withErrors(['Could not update user']);
        } catch (Exception $e) {
            return back()->withErrors($e->getMessage());
        }
    }
1351434
protected function movePositionUpOrDown($up = true)
    {
        // The current position of the object
        $myPosition = $this->getPosition();

        // Find object to exchange position with
        $search = $this->createQuery();

        $this->addCriteriaToPositionQuery($search);

        // Up or down ?
        if ($up === true) {
            // Find the object immediately before me
            $search->filterByPosition(array('max' => $myPosition-1))->orderByPosition(Criteria::DESC);
        } else {
            // Find the object immediately after me
            $search->filterByPosition(array('min' => $myPosition+1))->orderByPosition(Criteria::ASC);
        }

        $result = $search->findOne();

        // If we found the proper object, exchange their positions
        if ($result) {
            $cnx = Propel::getWriteConnection($this->getDatabaseName());

            $cnx->beginTransaction();

            try {
                $this
                    ->setPosition($result->getPosition())
                    ->save($cnx)
                ;

                // For BC
                if (method_exists($result, 'setDispatcher') && method_exists($this, 'getDispatcher')) {
                    $result->setDispatcher($this->getDispatcher());
                }

                $result->setPosition($myPosition)->save($cnx);

                $cnx->commit();
            } catch (\Exception $e) {
                $cnx->rollback();
            }
        }
    }
272598
public function activate($userId, $token, array $queryParams = [])
    {
        $response = $this->api->users()->activate($userId, $token, $queryParams);

        return new UserResponse($response);
    }
47530
private static function getUriForUriPointer(UriPointer $uriPointer) {

		static $uriBuilder;
		if (!$uriBuilder) {
			/** @var \Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager */
			$objectManager = Bootstrap::$staticObjectManager;

			/** @var ActionRequest $request */
			$request = new ActionRequest(Request::createFromEnvironment());

			/** @var UriBuilder $uriBuilder */
			$uriBuilder = $objectManager->get(UriBuilder::class);
			$uriBuilder->setRequest($request);

		}

		$uri = $uriBuilder
			->reset()
			->setCreateAbsoluteUri(TRUE)
			->uriFor($uriPointer->getActionName(), $uriPointer->getArguments(), $uriPointer->getControllerName(), $uriPointer->getPackageKey(), $uriPointer->getSubPackageKey());

		return $uri;
	}