Sets the price of the item.

@param Illuminate\Database\Eloquent\Model
@return void
@throws ItemPriceMissing
326911
protected function setPrice($entity)
    {
        if (method_exists($entity, 'getPrice')) {
            $this->price = $entity->getPrice();

            return;
        }

        if ($entity->offsetExists('price')) {
            $this->price = $entity->price;

            return;
        }

        throw ItemPriceMissing::for($this->modelType);
    }
1372244
public function setValue(Model $model)
    {
        if ($this->relation) {
            if (!$relationValue = $model->{$this->relation}) {
                return $this;
            }

            $this->value = $relationValue;
        } else {
            $this->value = $model->getAttribute($this->name);
        }

        return $this;
    }
129584
public function SetPriceBasedOnActiveDiscounts()
    {
        // this should only ever be executed once...
        $bDiscountedPriceUsed = $this->GetFromInternalCache('bDiscountedPriceUsed');
        if (is_null($bDiscountedPriceUsed) || false == $bDiscountedPriceUsed) {
            $bDiscountedPriceUsed = true;
            $dDiscountValue = $this->GetPriceIfDiscounted();
            if ($dDiscountValue < $this->fieldPrice) {
                $this->aPriceBeforeDiscount['fieldPrice'] = $this->fieldPrice;
                $this->aPriceBeforeDiscount['fieldPriceReference'] = $this->fieldPriceReference;
                $oLocal = &TCMSLocal::GetActive();
                $this->fieldPriceReference = $this->fieldPrice;
                $this->fieldPriceReferenceFormated = $this->fieldPriceFormated;
                $this->fieldPrice = $dDiscountValue;
                $this->fieldPriceFormated = $oLocal->FormatNumber($dDiscountValue, 2);
                $this->dPrice = $this->fieldPrice;
            }
            $this->SetInternalCache('bDiscountedPriceUsed', $bDiscountedPriceUsed);
        }
    }
250500
public function set_value($value) {

        if (!empty($value) && !$this->field->isChecked()) {

            if (!$this->running_javascript()) {
                $this->field->check();
                return;
            }

            // Check it if it should be checked and it is not.
            $this->field->click();

            // Trigger the onchange event as triggered when 'checking' the checkbox.
            $this->trigger_on_change();

        } else if (empty($value) && $this->field->isChecked()) {

            if (!$this->running_javascript()) {
                $this->field->uncheck();
                return;
            }

            // Uncheck if it is checked and shouldn't.
            $this->field->click();

            // Trigger the onchange event as triggered when 'checking' the checkbox.
            $this->trigger_on_change();
        }
    }
601745
public function setValue($value)
	{
		if ( $value == $this->getValue() ) {
			return;
		}

		$this->_values['value'] = (string) $value;

		$this->setModified();
	}
1253319
public function set(string $key, $value): void
    {
        Arr::set($this->items, $key, $value, true);
    }
1233901
public function addValue($value)
    {
        $values = $this->getValues();
        array_push($values, $value);
        $this->setValues($values);
    }
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;
    }
1347103
protected function setPriceListAttribute($arPriceList)
    {
        if (empty($arPriceList) || !is_array($arPriceList)) {
            return;
        }

        if (isset($arPriceList[0])) {
            $this->fSavedPrice = array_get($arPriceList[0], 'price');
            $this->fSavedOldPrice = array_get($arPriceList[0], 'old_price');
            unset($arPriceList[0]);
        }

        $this->arSavedPriceList = $arPriceList;
    }
581335
@Override
  public final void setItem(final InvItem pItem) {
    this.item = pItem;
    if (getItsId() == null) {
      setItsId(new GoodsSpecificsId());
    }
    getItsId().setItem(this.item);
  }
1069223
private function setItemsInformation()
    {
        foreach ($this->_checkoutSession->getLastRealOrder()->getAllVisibleItems() as $product) {
            $this->_paymentRequest->addItems()->withParameters(
                $product->getProduct()->getId(), //id
                \UOL\PagSeguro\Helper\Data::fixStringLength($product->getName(), 255), //description
                $product->getSimpleQtyToShip(), //quantity
                \UOL\PagSeguro\Helper\Data::toFloat($product->getPrice()), //amount
                round($product->getWeight()) //weight
            );
        }
    }
1327395
public function calculateItemTotalNetPrice($item, $currency = null, $useProductsPrice = true, $isGrossPrice = false)
    {
        $priceValue = $this->calculateItemNetPrice($item, $currency, $useProductsPrice, $isGrossPrice);

        if ($priceValue === null) {
            $priceValue = 0;
        }

        if ($item->getPrice() && $item->getPrice() !== $priceValue) {
            $item->setPriceChange($item->getPrice(), $priceValue);
        }

        $itemPrice = $priceValue * $item->getCalcQuantity();

        // Calculate items discount.
        $discount = ($itemPrice / 100) * $item->getCalcDiscount();

        // Calculate total item price.
        $totalPrice = $itemPrice - $discount;

        return $totalPrice;
    }
615823
public function calculateItemNetPrice($item, $currency = null, $useProductsPrice = null, $isGrossPrice = false)
    {
        $currency = $this->getCurrency($currency);

        if ($useProductsPrice === null) {
            $useProductsPrice = $item->getUseProductsPrice();
        }

        // Validate item
        $this->validateItem($item);

        $priceValue = $item->getPrice();

        if ($useProductsPrice && ($item->getCalcProduct() || $item->getAddon())) {
            $priceValue = $this->getValidProductNetPriceForItem($item, $currency);
        } elseif ($isGrossPrice) {
            // Handle gross prices.
            $tax = $item->getTax();
            if ($tax > 0) {
                $priceValue = ($priceValue / (100 + $tax)) * 100;
            }
        }

        return $priceValue;
    }
1115986
public function setLevel($level)
    {
        parent::setLevel($level);

        foreach ($this->items as $item) {
            $item->setLevel($level + 1);
        }
    }
1335873
public function setValue($size)
    {
        $this->size = $size;
        if (($this->multiplier !== 0) && ($this->size > -1)) {
            $this->sizelimit = $size * $this->multiplier;
        }
    }
1243375
public function setCosts( $price )
	{
		if ( $price == $this->getCosts() ) { return; }

		$this->_checkPrice( $price );

		$this->_values['costs'] = $this->_formatNumber( $price );
		$this->setModified();
	}
891498
function updatePrices()
    {
        $productCollection = $this->attribute( 'productcollection' );
        if ( $productCollection )
        {
            $currencyCode = '';
            $items = $this->items();

            $db = eZDB::instance();
            $db->begin();
            foreach( $items as $itemArray )
            {
                $item = $itemArray['item_object'];
                $productContentObject = $item->attribute( 'contentobject' );
                $priceObj = null;
                $price = 0.0;
                $attributes = $productContentObject->contentObjectAttributes();
                foreach ( $attributes as $attribute )
                {
                    $dataType = $attribute->dataType();
                    if ( eZShopFunctions::isProductDatatype( $dataType->isA() ) )
                    {
                        $priceObj = $attribute->content();
                        $price += $priceObj->attribute( 'price' );
                        break;
                    }
                }
                if ( !is_object( $priceObj ) )
                    break;

                $currency = $priceObj->attribute( 'currency' );
                $optionsPrice = $item->calculatePriceWithOptions( $currency );

                $price += $optionsPrice;
                $item->setAttribute( "price", $price );
                if ( $priceObj->attribute( 'is_vat_included' ) )
                {
                    $item->setAttribute( "is_vat_inc", '1' );
                }
                else
                {
                    $item->setAttribute( "is_vat_inc", '0' );
                }
                $item->setAttribute( "vat_value", $priceObj->VATPercent( $productContentObject ) );
                $item->setAttribute( "discount", $priceObj->attribute( 'discount_percent' ) );
                $item->store();

                $currencyCode = $priceObj->attribute( 'currency' );
            }

            $productCollection->setAttribute( 'currency_code', $currencyCode );
            $productCollection->store();
            $db->commit();

            // update prices that are related to shipping values.
            eZShippingManager::updateShippingInfo( $productCollection->attribute( 'id' ) );
        }
    }