{@inheritDoc}

@since 0.10.0
495192
@Override
    public BaseJsonBo setAttribute(String attrName, Object value) {
        return setAttribute(attrName, value, true);
    }
187035
public function complete()
    {
        foreach ($this->getConfigKey('Placeholders') as $key => $data) {
            $default = $data['default'];
            if (is_callable($default)) {
                $default = $default($this->getConfigKey('Placeholders'));
            }

            $value = $default;
            try {
                $value = $this->io->askAndValidate(
                    sprintf(
                        '<question>%1$s</question> [%2$s] <info>Default: "%3$s"</info> ? ',
                        $data['name'],
                        $data['description'],
                        $default
                    ),
                    $data['validation'],
                    null,
                    $default
                );
            } catch (Exception $exception) {
                // Fail silently.
            }

            $this->config['Placeholders'][$key]['value'] = $value;
        }
    }
432831
public function hasChanged($fields)
    {
        if ($this->_snapshot === false) {
            throw new PreconditionException(['getChangedFields failed: `:model` instance is snapshot disabled', 'model' => static::class]);
        }

        /** @noinspection ForeachSourceInspection */
        foreach ((array)$fields as $field) {
            if (!isset($this->_snapshot[$field]) || $this->{$field} !== $this->_snapshot[$field]) {
                return true;
            }
        }

        return false;
    }
1013462
public function set($keys, $value = null)
    {
        if (is_array($keys)) {
            foreach ($keys as $key => $value) {
                $this->set($key, $value);
            }

            return;
        }

        $items = &$this->items;

        foreach (explode('.', $keys) as $key) {
            if (!isset($items[$key]) || !is_array($items[$key])) {
                $items[$key] = [];
            }

            $items = &$items[$key];
        }

        $items = $value;
    }
906555
public function offset( $offset ) {
		$this->offset = $offset;
		if ( false === starts_with( $offset . '', ':' ) ) {
			$this->offset = (int) $offset;
		}
	}
936248
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        parent::execute($request);

        /** @var OrderPaymentInterface $payment */
        $payment = $request->getSource();
        /** @var array $model */
        $model = $request->getResult();

        $model['NOSHIPPING'] = 1;
        $model['LANDINGPAGE'] = 'Billing';
        $model['SOLUTIONTYPE'] = 'Sole';

        $order = $payment->getOrder();
        $orderTotal = $this->calculator->calculateOrderTotal($order, true);
        $paymentAmount = $payment->getAmount();

        // Add item details only if this is a full order payement.
        if (0 == bccomp($orderTotal, $paymentAmount, 2)) {
            $m = 0;
            foreach($order->getItems() as $item) {
                $model['L_PAYMENTREQUEST_0_NAME'.$m] = $item->getDesignation();
                $model['L_PAYMENTREQUEST_0_AMT'.$m] = round($item->getPrice(), 2);
                $model['L_PAYMENTREQUEST_0_QTY'.$m] = $item->getQuantity();
                $m++;
            }
            $model['PAYMENTREQUEST_0_ITEMAMT'] = round($this->calculator->calculateOrderItemsTotal($order), 2);

            $model['PAYMENTREQUEST_0_SHIPPINGAMT'] = round($this->calculator->calculateOrderShipmentTotal($order), 2);

            $taxes = $this->calculator->calculateOrderTaxesAmounts($order);
            $model['PAYMENTREQUEST_0_TAXAMT'] = round($taxes->getTotal(), 2);
        }

        $request->setResult((array) $model);
    }
763766
public function compileFrom()
    {
        $fromQuery = '';

        foreach ($this->query->getQueryFrom() as $key => $value) {
            if ($key == 0) {
                $fromQuery = "$value";
            } else {
                $fromQuery .= ",$value";
            }
        }

        $this->queryString = "{$this->queryString} FROM $fromQuery";
    }
1198739
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        /** @var PaymentInterface $payment */
        $payment = $request->getSource();

        /** @var OrderInterface $order */
        $params = [
            'payment_id' => $payment->getNumber(),
            'payment_amount' => $payment->getTotalAmount(),
            'payment_currency' => $payment->getCurrencyCode(),
            'project_id' => $this->api['projectId'],
            'customer_id' => $payment->getClientId(),
        ];
        $request->setResult($params);
    }
1092286
public function resolve()
    {
        foreach ($this->mappings as $mapping) {
            $mapping->removeConflict($this);
        }

        $this->mappings = array();
    }
1335166
public function context(ContextInterface $context)
    {
        if (!empty($this->vary)) {
            $this->varyValue = $context->get($this->vary);
        }
    }
1259681
public function filter()
    {
        $blueprints = $this->blueprints();
        $values = $blueprints->filter($this->toArray());
        if ($values && isset($values['header'])) {
            $this->header($values['header']);
        }
    }
434343
public function setId( $key )
	{
		if( $key !== null )
		{
			$this->setCode($key);
			$this->_values['id'] = $this->_values['code'];
			$this->_modified = false;
		}
		else
		{
			$this->_values['id'] = null;
			$this->_modified = true;
		}
	}
1128094
public function unserialize($serialized)
    {
        parent::unserialize($serialized);
        foreach ( $this->getMethods() as $item ) {
            $item->setBelongsTo($this);
        }
//        foreach ( $this->getConstants() as $item ) {
//            $item->setBelongsTo($this);
//        }
        foreach ( $this->getProperties() as $item ) {
            $item->setBelongsTo($this);
        }
        foreach ( $this->getTags() as $item ) {
            $item->setBelongsTo($this);
        }
//        return;
//        foreach ( [ $this->getMethods(), $this->getProperties(), $this->getConstants(), $this->getTags() ] as $collection ) {
//            /** @var Collection|AbstractStructure[] $collection */
//            foreach ( $collection as $item ) {
//                $item->setBelongsTo($this);
//            }
//        }
    }
1346618
public function forceEndDocument(): void
    {
        if (empty($this->stack)) {
            return;
        }

        $key = $this->keys;
        for ($i = $this->level - 1; $i > 0; --$i) {
            $value = array_pop($this->stack);
            //value
            $obj = array_pop($this->stack);
            if (!empty($key[$i])) {
                $obj[$key[$i]] = $value;
                $key[$i] = null;
            } else {
                $obj[] = $value;
            }
            if ($i > 1) {
                $this->stack[] = $obj;
            } else {
                $this->json = $obj;
            }
        }
    }
621504
public function resolveMapping($resource, $parameters = [], $key = 'default', $method = null)
	{
		$resourceName = $resource;

		if( is_object($resource) )
		{
			$resourceName = get_class($resource);
		}

		$mappings = $this->getMappings($resourceName, $key);

		if(empty($mappings))
		{
			throw new Exception('No resolvers mapped for resource: ' . $resourceName . '.');
		}

		$result = null;

		if(is_array($mappings))
		{
			return $this->runResolver($mappings[0], $parameters, $method);
		}

		return $this->runResolver($mappings, $parameters, $method);
	}
157978
public function persist(PersistenceContext $context, ParentChildMap $map)
    {
        /** @var Row[] $parentRows */
        $parentRows = [];
        /** @var object[] $children */
        $children = [];

        foreach ($map->getItems() as $key => $item) {
            $parentRow = $item->getParent();

            $hasChild = (bool)$item->getChild();
            if ($hasChild) {
                $parentRows[$key] = $parentRow;
                $children[$key]   = $item->getChild();
            }

            if ($this->objectIssetColumnName && !$this->isWithinValueObject) {
                $parentRow->setColumn($this->objectIssetColumnName, $hasChild);
            }
        }

        $this->disableLazyLoadingForRelations(function () use ($context, $children, $parentRows) {
            $this->mapper->persistAllToRows($context, $children, $parentRows);
        });
    }
82043
public function value($value): void
    {
        $obj = array_pop($this->stack);
        if (!empty($this->keys[$this->level])) {
            $obj[$this->keys[$this->level]] = $value;
            $this->keys[$this->level] = null;
        } else {
            $obj[] = $value;
        }
        $this->stack[] = $obj;
    }