@return mixed

@throws \Picqer\Financials\Moneybird\Exceptions\ApiException
554824
public function update()
    {
        $result = $this->connection()->patch($this->getEndpoint() . '/' . urlencode($this->id), $this->jsonWithNamespace());
        if ($result === 200) {
            return true;
        }

        return $this->selfFromResponse($result);
    }
579327
public function getShipping()
    {
        return new ApiShipping(
            $this->entity->getShipping(),
            $this->locale,
            $this->itemFactory,
            $this->priceFormatter
        );
    }
1198816
public function get()
    {
         // run the callbacks to retirve the results
        $results = $this->executeResultFetcher();

        // we always exprect an array here!
        if (!is_array($results) || empty($results))
        {
            $results = array();
        }

        // In case we should forward a key means using a value
        // from every result as array key.
        if ((!empty($results)) && $this->forwardKey !== false && is_string($this->forwardKey)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $result) 
            {
                $results[$result[$this->forwardKey]] = $result;
            }
        }

        // Group the resuls by a items value
        if ((!empty($results)) && $this->groupResults !== false && is_string($this->groupResults)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $key => $result) 
            {
                $results[$result[$this->groupResults]][$key] = $result;
            }
        }

        // when the limit is specified to exactly one result we
        // return directly that one result instead of the entire array
        if ($this->limit === 1) 
        {
            $results = reset($results);
        }

        return $results;
    }
1028859
public function getPending()
    {
        $dqb = $this->_em->createQueryBuilder();
        $dqb->select(array('j'))
            ->from('PlaygroundCore\Entity\Cronjob', 'j')
            ->where($dqb->expr()->in('j.status', array(self::STATUS_PENDING)))
            ->orderBy('j.scheduleTime', 'ASC');

        return $dqb->getQuery()->getResult();
    }
1363082
public static function get(
        int $bunqmeFundraiserResultId,
        int $noteAttachmentBunqMeFundraiserResultId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseNoteAttachmentBunqMeFundraiserResult {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $bunqmeFundraiserResultId,
                    $noteAttachmentBunqMeFundraiserResultId,
                ]
            ),
            [],
            $customHeaders
        );

        return BunqResponseNoteAttachmentBunqMeFundraiserResult::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
1041674
public function update()
    {
        $this->helper->progress('--- Currencies');

        $this->helper->eraseDataDir($dataDir = '/currencies/default');

        $currencies = $this->helper->loadJsonFiles($directory = $this->helper->dataDir('third-party/world-currencies/package/src'));

        if ($currencies->isEmpty()) {
            throw new Exception("No currencies found in {$directory}");
        }

        $currencies = $currencies->mapWithKeys(function ($currency) {
            return $currency;
        });

        $this->helper->message('Processing currencies...');

        $normalizerClosure = function ($item) {
            $item = $this->updater->addDataSource($item, 'world-currencies');

            $item = $this->updater->addRecordType($item, 'currency');

            return [$item];
        };

        $getCodeClosure = function () {
        };

        $generateTaxData = function ($tax) {
            return $tax;
        };

        $currencies = $this->updater->generateJsonFiles($currencies, $dataDir, $normalizerClosure, $getCodeClosure, $generateTaxData, null);

        $this->helper->progress('Generated '.count($currencies).' currencies.');
    }
582890
public function get()
    {
        $value = str_replace(static::WRAPPER, '', $this->value);

        if (! method_exists($this, $value)) {
            return $this->value;
        }

        return $this->{$value}();
    }
939529
protected function validate()
    {
        $result = $this->request($action = 'CheckCredits');
        if ((int) $result <= 0) {
            throw new Exception($this->config['codes']['-100']);
        }
        return $result;
    }
661428
public function getValue()
    {
        if (!$this->exists()) {
            return null;
        }
        $amount = $this->getAmount();
        $currency = $this->getCurrency();
        if (empty($currency)) {
            return $amount;
        }
        return $amount . ' ' . $currency;
    }
1042391
public function apiStore()
    {
        DB::beginTransaction();

        try {
            $record = $this->__apiStore();
        } catch (\Exception $e) {
            DB::rollback();

            return HCLog::error('CORE-0002' . $e->getCode(), $e->getMessage());
        }

        DB::commit();

        return response($record);
    }
761534
public function get()
    {

        $class = null;

        // decide the most accurate exception we've got for this state and throw that
        if( $this->state ) {

            for( $i = 5; $i > 0; $i-- ) {
               $exceptionQueue[] = sprintf(
                "State%s",
                substr( $this->state, 0, $i )
               );
            }

            while( !$class and $_class = array_shift( $exceptionQueue ) ) {
                $file = __DIR__ . "/Exception/States/{$_class}.php";
                if( file_exists($file) ) {
                    $class = $_class;
                }
            }

        }

        // decide on class
        if( !$class ) {
            $class = 'Bond\Pg\Exception\QueryException';
        } else {
            $class = 'Bond\Pg\Exception\States\\'. $class;
        }

        //die( $class );

        return new $class(
            $this->sqlError,
            $this->state,
            self::getStateMessage($this->state),
            $this->sql
        );

    }
1366293
public function parse()
    {
        $bills = [];
        $billTemplate = new Bill(['scenario' => Bill::SCENARIO_CREATE]);

        $lines = explode("\n", $this->data);

        try {
            foreach ($lines as $line) {
                $line = trim($line);
                if ($line === '') {
                    continue;
                }

                $bills[] = $bill = clone $billTemplate;

                list($client, $time, $sum, $currency, $type, $label) = $this->splitLine($line);
                $quantity = 1;
                $bill->setAttributes(compact('client', 'time', 'sum', 'currency', 'type', 'label', 'quantity'));
                $bill->populateRelation('charges', []);
            }

            $this->resolveClients(ArrayHelper::getColumn($bills, 'client'));

            foreach ($bills as $bill) {
                $bill->time = \Yii::$app->formatter->asDatetime($this->resolveTime($bill->time), 'php:d.m.Y H:i:s');
                $bill->type = $this->resolveType($bill->type);
                $bill->client_id = $this->convertClientToId($bill->client);
            }
        } catch (InvalidValueException $e) {
            $this->addError('data', $e->getMessage());

            return false;
        }

        return empty($bills) ? false : $bills;
    }
1060233
public function getFUnitPrice()
    {
        if ($this->_fPricePerUnit == null) {
            if ($oPrice = $this->getUnitPrice()) {
                if ($dPrice = $this->_getPriceForView($oPrice)) {
                    $this->_fPricePerUnit = \OxidEsales\Eshop\Core\Registry::getLang()->formatCurrency($dPrice);
                }
            }
        }

        return $this->_fPricePerUnit;
    }
244522
public function getPayPalRequest()
    {
        if (is_null($this->payPalRequest)) {
            $requestBuilder = $this->getPayPalRequestBuilder();

            $data = $this->getData();

            $requestBuilder->setTransactionId($data->getTransactionId());
            $requestBuilder->setAmount($data->getAmount(), $data->getCurrency());
            $requestBuilder->setRefundType($data->getType());
            $requestBuilder->setComment($data->getComment());

            $this->payPalRequest = $requestBuilder->getRequest();
        }

        return $this->payPalRequest;
    }
1062234
public function Nice()
    {
        if (!$this->exists()) {
            return null;
        }
        $amount = $this->getAmount();
        $currency = $this->getCurrency();

        // Without currency, format as basic localised number
        $formatter = $this->getFormatter();
        if (!$currency) {
            return $formatter->format($amount);
        }

        // Localise currency
        return $formatter->formatCurrency($amount, $currency);
    }
1306559
public function getAccount()
    {
        $uuid = $this->getProperty('id');
        $url = $this->makeAbsoluteUrl('/api/users');
        $account = Account::get($uuid, $url, $this->client);
        if (!$account) {
            throw new \Exception("Account not found for user: " . $uuid);
        }
        return $account;
    }
786036
public function getData()
    {
        if ($this->getAppleReference() !== null) {
            $this->validate('amount', 'appleReference');

            $data = [
                'opcode'      => 4,
                'product_id'  => $this->getProductId(),
                'apple_token' => urlencode(base64_encode(json_encode($this->getAppleReference()))),
                'token'       => $this->getRequestToken(),
            ];
        } elseif ($this->getCardReference() !== null) {
            $this->validate(
                'amount',
                'card',
                'cardReference',
                'transactionId',
                'clientIp',
                'returnUrl'
            );

            $data = [
                'opcode'      => 21,
                'product_id'  => $this->getProductId(),
                'payment_id'  => $this->getCardReference(),
                'amount'      => $this->getAmount(),
                'cf'          => $this->getTransactionId(),
                'ip_address'  => $this->getClientIp(),
                'cvv'         => $this->getCard()->getCvv(),
                'pp_identity' => 'card',
                'token'       => $this->getRequestToken(),
            ];
        } else {
            $this->validate(
                'amount',
                'card',
                'transactionId',
                'clientIp',
                'returnUrl'
            );

            $card = $this->getCard();

            $card->validate();

            $data = [
                'opcode'      => 0,
                'product_id'  => $this->getProductId(),
                'amount'      => $this->getAmount(),
                'cf'          => $this->getTransactionId(),
                'ip_address'  => $this->getClientIp(),
                'pan'         => $card->getNumber(),
                'cardholder'  => $card->getName(),
                'exp_month'   => $card->getExpiryMonth(),
                'exp_year'    => $card->getExpiryYear(),
                'cvv'         => $card->getCvv(),
                'pp_identity' => 'card',
                'token'       => $this->getRequestToken(),
            ];
        }

        if ($this->getPhone()) {
            $data['phone'] = $this->getPhone();
        }
        if ($this->getCf2()) {
            $data['cf2'] = $this->getCf2();
        }
        if ($this->getCf3()) {
            $data['cf3'] = $this->getCf3();
        }
        if ($this->getCallbackUrl()) {
            $data['cb_url'] = $this->getCallbackUrl();
        }

        return $data;
    }