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);
    }
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);
    }
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 ) ; }
Sets the price of the item.

@param Illuminate\Database\Eloquent\Model
@return void
@throws ItemPriceMissing
Sets the price of the item .