Set purchasesAccount

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2013-02-09

@param  \HarvestCloud\CoreBundle\Entity\Account $purchasesAccount

@return Profile
436767
public function setPurchasesAccount(\HarvestCloud\CoreBundle\Entity\Account $purchasesAccount = null)
    {
        $this->purchasesAccount = $purchasesAccount;

        return $this;
    }
683828
public function setUserAccount($userAccount)
    {
        $userAccount = is_string($userAccount) ? [$userAccount] : $userAccount;
        $this->setParameter('User_Account', $userAccount);
        return $this;
    }
347590
public function useAccount($account = null)
    {
        $account = $account ?: Core::instance()->getConfig('default');

        if (!Core::instance()->getConfig("accounts.{$account}")) {
            throw new Exception('Invalid account selected');
        }

        $this->account = $account;

        return $this;
    }
315725
public function setTransfersToBankAccount($amount, $bankAccountId)
    {
        $this->data->amount = $amount;
        $this->data->transferInstrument->method = self::METHOD;
        $this->data->transferInstrument->bankAccount->id = $bankAccountId;

        return $this;
    }
1089421
public function authorizeOrderAmount($authorizationAmount)
    {
        $authorizeRequest = new OffAmazonPaymentsService_Model_AuthorizeRequest();
        $authorizeRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
        $authorizeRequest->setSellerId($this->_sellerId);
        $authorizeRequest->setAuthorizationReferenceId($this->_authorizationReferenceId);
        $authorizeRequest->setAuthorizationAmount(new OffAmazonPaymentsService_Model_Price());
        $authorizeRequest->getAuthorizationAmount()->setAmount($authorizationAmount);
        $authorizeRequest->getAuthorizationAmount()->setCurrencyCode($this->_service->getMerchantValues()->getCurrency());
        
        return $this->_service->authorize($authorizeRequest);
    }
611651
protected function setAccount($account)
	{
		if (empty($account))
		{
			throw new \InvalidArgumentException("Label can't contain empty strings");
		}

		$this->label .= str_replace('%40', '@', rawurlencode($account));
	}
1140180
public void setCommerceAccountUserRelLocalService(
		com.liferay.commerce.account.service.CommerceAccountUserRelLocalService commerceAccountUserRelLocalService) {
		this.commerceAccountUserRelLocalService = commerceAccountUserRelLocalService;
	}
632760
public static function authenticate($account = null)
    {
        $configs = (new ConfigurationRepository)->useAccount($account);
        $key = $configs->getAccountKey('key');
        $secret = $configs->getAccountKey('secret');
        $cacheKey = self::AC_TOKEN . "{$key}{$secret}";

        if ($token = Core::instance()->cache()->get($cacheKey)) {
            return $token;
        }

        try {
            $response = self::makeRequest($key, $secret, $account);
            $body = json_decode($response->getBody());
            self::saveCredentials($cacheKey, $body);

            return $body->access_token;
        } catch (RequestException $exception) {
            $message = $exception->getResponse() ?
               $exception->getResponse()->getReasonPhrase() :
               $exception->getMessage();

            throw self::generateException($message);
        }
    }
271061
public function setToAccount($toAccount)
    {
        $toAccount = is_array($toAccount) ? $toAccount : [$toAccount];
        $this->setParameter('To_Account', $toAccount);
        return $this;
    }
365538
public function setAccountID($accountID)
    {
        if (trim($accountID) == null)
        {
            throw new InvalidArgumentException("You must supply an account ID.");
        }

        if (!is_numeric($accountID))
        {
            throw new InvalidArgumentException("Account ID must be numeric.");
        }
        $this->accountID = intval($accountID);
    }
1197058
func (c *Client) SetAccount(address btcutil.Address, account string) error {
	return c.SetAccountAsync(address, account).Receive()
}
1284224
public function getAccountKey($key, $default = null, $account = null)
    {
        if (!$this->account || ($account && $account !== $this->account)) {
            $this->useAccount($account);
        }

        return Core::instance()->getConfig("accounts.{$this->account}.{$key}", $default);
    }
664601
public function createChild($account) {
        $id = $this->getId();
        $payload = $account->getPayload();

        $this->setTokenValue($this->getEntityIdName(), $id);

        $response = $this->put($payload);

        $entity = $response->getData();
        $this->setEntity($entity);

        return $this;
    }
1306695
public function setDisplayAccount($displayAccount = true)
    {
        $this->isBool($displayAccount, 'displayAccount');
        $this->displayAccount = $displayAccount;

        return $this;
    }
623796
@Override
	@Transactional(enabled = false)
	public CommerceAccountUserRel createCommerceAccountUserRel(
		CommerceAccountUserRelPK commerceAccountUserRelPK) {
		return commerceAccountUserRelPersistence.create(commerceAccountUserRelPK);
	}
986257
public function getAssignedPartyOfAccount(Account $account)
    {
        $accountIdentifier = $this->persistenceManager->getIdentifierByObject($account);

        // We need to prevent stale object references and therefore only cache the identifier.
        if (!array_key_exists($accountIdentifier, $this->accountsInPartyRuntimeCache)) {
            $party = $this->partyRepository->findOneHavingAccount($account);
            $this->accountsInPartyRuntimeCache[$accountIdentifier] = $party === null ? null : $this->persistenceManager->getIdentifierByObject($party);

            return $party;
        }

        if ($this->accountsInPartyRuntimeCache[$accountIdentifier] !== null) {
            $partyIdentifier = $this->accountsInPartyRuntimeCache[$accountIdentifier];

            return $this->persistenceManager->getObjectByIdentifier($partyIdentifier, AbstractParty::class);
        }

        return null;
    }
336463
public final GoogleAccountCredential setSelectedAccount(Account selectedAccount) {
    this.selectedAccount = selectedAccount;
    this.accountName = selectedAccount == null ? null : selectedAccount.name;
    return this;
  }