Свойство | Тип | Описание | |
---|---|---|---|
$basketElementManager | Sonata\Component\Basket\BasketElementManagerInterface | ||
$code | string | ||
$currencyPriceCalculator | Sonata\Component\Currency\CurrencyPriceCalculatorInterface | ||
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | ||
$options | array | ||
$orderElementClassName | string | ||
$productCategoryManager | Sonata\Component\Product\ProductCategoryManagerInterface | ||
$productCollectionManager | Sonata\Component\Product\ProductCollectionManagerInterface | ||
$serializer | JMS\Serializer\SerializerInterface | ||
$variationFields | array |
Метод | Описание | |
---|---|---|
__construct ( JMS\Serializer\SerializerInterface $serializer ) | ||
basketAddProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, Sonata\Component\Basket\BasketElementInterface $basketElement ) : boolean | Sonata\Component\Basket\BasketElementInterface | Adds $basketElement related to $product to $basket. | |
basketMergeProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, Sonata\Component\Basket\BasketElementInterface $newBasketElement ) : boolean | Sonata\Component\Basket\BasketElementInterface | Merge a product with another when the product is already present into the basket. | |
buildBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product = null, array $options = [] ) | ||
buildCreateForm ( Sonata\AdminBundle\Form\FormMapper $formMapper ) | ||
buildEditForm ( Sonata\AdminBundle\Form\FormMapper $formMapper, $isVariation = false ) | ||
buildForm ( Symfony\Component\Form\FormBuilderInterface $builder, array $options, $isVariation = false ) | ||
calculatePrice ( Sonata\Component\Product\ProductInterface $product, Sonata\Component\Currency\CurrencyInterface $currency, $vat = false, $quantity = 1 ) | ||
configureShowFields ( Sonata\AdminBundle\Show\ShowMapper $showMapper ) | ||
createBasketElement ( Sonata\Component\Product\ProductInterface $product = null, array $options = [] ) | (non-PHPdoc). | |
createOrderElement ( Sonata\Component\Basket\BasketElementInterface $basketElement, string $format = 'json' ) : Sonata\Component\Order\OrderElementInterface | ||
createVariation ( Sonata\Component\Product\ProductInterface $product, $copyDependencies = true ) | ||
defineAddBasketForm ( Sonata\Component\Product\ProductInterface $product, |
This function return the form used in the product view page. | |
defineBasketElementForm ( Sonata\Component\Basket\BasketElementInterface $basketElement, |
||
findOneById ( integer $id ) : boolean | ||
getBasketElementManager ( ) : Sonata\Component\Basket\BasketElementManagerInterface | ||
getCheapestEnabledVariation ( Sonata\Component\Product\ProductInterface $product ) | ||
getCode ( ) : string | ||
getCurrencyPriceCalculator ( ) : Sonata\Component\Currency\CurrencyPriceCalculatorInterface | ||
getEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | ||
getFilters ( ) | ||
getOption ( string $name, mixed $default = null ) : array | null | ||
getOptions ( ) : array | ||
getProductCategoryManager ( ) | ||
getProductCollectionManager ( ) | ||
getProductFromRaw ( Sonata\Component\Order\OrderElementInterface $orderElement, string $type, string $format = 'json' ) : Sonata\Component\Product\ProductInterface | ||
getRawProduct ( Sonata\Component\Product\ProductInterface $product, string $format = 'json' ) : array | ||
getStockAvailable ( Sonata\Component\Product\ProductInterface $product ) | ||
getVariatedProperties ( Sonata\Component\Product\ProductInterface $product, array $fields = [] ) | ||
getVariation ( Sonata\Component\Product\ProductInterface $product, array $choices = [] ) | ||
getVariationFields ( ) : array | ||
getVariationsChoices ( Sonata\Component\Product\ProductInterface $product, array $fields = [] ) | ||
hasEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
hasVariationFields ( ) : boolean | ||
hasVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
isAddableToBasket ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, array $options = [] ) : boolean | Return true if the product can be added to the provided basket. | |
isValidBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement ) : boolean | ||
isVariateBy ( $name ) : boolean | ||
reloadProduct ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | return a fresh product instance (so information are reloaded: enabled and stock . | |
setBasketElementManager ( Sonata\Component\Basket\BasketElementManagerInterface $basketElementManager ) | ||
setCode ( string $code ) | ||
setCurrencyPriceCalculator ( Sonata\Component\Currency\CurrencyPriceCalculatorInterface $currencyPriceCalculator ) | ||
setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) | ||
setOptions ( array $options = [] ) | ||
setOrderElementClassName ( string $orderElementClassName ) | ||
setProductCategoryManager ( Sonata\Component\Product\ProductCategoryManagerInterface $productCategoryManager ) | ||
setProductCollectionManager ( Sonata\Component\Product\ProductCollectionManagerInterface $productCollectionManager ) | ||
setVariationFields ( array $fields = [] ) | ||
synchronizeVariations ( Sonata\Component\Product\ProductInterface $product, |
||
synchronizeVariationsCategories ( Sonata\Component\Product\ProductInterface $product, |
||
synchronizeVariationsCollections ( Sonata\Component\Product\ProductInterface $product, |
||
synchronizeVariationsDeliveries ( Sonata\Component\Product\ProductInterface $product, |
||
synchronizeVariationsPackages ( Sonata\Component\Product\ProductInterface $product, |
||
synchronizeVariationsProduct ( Sonata\Component\Product\ProductInterface $product, |
||
updateComputationPricesFields ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product ) | ||
updateStock ( $product, Sonata\Component\Product\ProductManagerInterface $productManager, $diff ) | ||
validateFormBasketElement ( Sonata\CoreBundle\Validator\ErrorElement $errorElement, Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Basket\BasketInterface $basket ) |
Метод | Описание | |
---|---|---|
getMergedFields ( array $fields ) : array | Checks $fields if specified, returns variation fields otherwise. |
public __construct ( JMS\Serializer\SerializerInterface $serializer ) | ||
$serializer | JMS\Serializer\SerializerInterface |
public basketAddProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, Sonata\Component\Basket\BasketElementInterface $basketElement ) : boolean | Sonata\Component\Basket\BasketElementInterface | ||
$basket | Sonata\Component\Basket\BasketInterface | |
$product | Sonata\Component\Product\ProductInterface | |
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
Результат | boolean | Sonata\Component\Basket\BasketElementInterface |
public basketMergeProduct ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, Sonata\Component\Basket\BasketElementInterface $newBasketElement ) : boolean | Sonata\Component\Basket\BasketElementInterface | ||
$basket | Sonata\Component\Basket\BasketInterface | |
$product | Sonata\Component\Product\ProductInterface | |
$newBasketElement | Sonata\Component\Basket\BasketElementInterface | |
Результат | boolean | Sonata\Component\Basket\BasketElementInterface |
public buildBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product = null, array $options = [] ) | ||
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
$product | Sonata\Component\Product\ProductInterface | |
$options | array |
public buildCreateForm ( Sonata\AdminBundle\Form\FormMapper $formMapper ) | ||
$formMapper | Sonata\AdminBundle\Form\FormMapper |
public buildEditForm ( Sonata\AdminBundle\Form\FormMapper $formMapper, $isVariation = false ) | ||
$formMapper | Sonata\AdminBundle\Form\FormMapper |
public calculatePrice ( Sonata\Component\Product\ProductInterface $product, Sonata\Component\Currency\CurrencyInterface $currency, $vat = false, $quantity = 1 ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$currency | Sonata\Component\Currency\CurrencyInterface |
public configureShowFields ( Sonata\AdminBundle\Show\ShowMapper $showMapper ) | ||
$showMapper | Sonata\AdminBundle\Show\ShowMapper |
public createBasketElement ( Sonata\Component\Product\ProductInterface $product = null, array $options = [] ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$options | array |
public createOrderElement ( Sonata\Component\Basket\BasketElementInterface $basketElement, string $format = 'json' ) : Sonata\Component\Order\OrderElementInterface | ||
$basketElement | Sonata\Component\Basket\BasketElementInterface | A basket element instance |
$format | string | A format to obtain raw product |
Результат | Sonata\Component\Order\OrderElementInterface |
public createVariation ( Sonata\Component\Product\ProductInterface $product, $copyDependencies = true ) | ||
$product | Sonata\Component\Product\ProductInterface |
public defineAddBasketForm ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | A Sonata product instance |
$formBuilder | Symfony form builder | |
$showQuantity | boolean | Specifies if quantity field will be displayed (default true) |
$options | array | An options array |
public defineBasketElementForm ( Sonata\Component\Basket\BasketElementInterface $basketElement, |
||
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
$formBuilder | ||
$options | array |
public findOneById ( integer $id ) : boolean | ||
$id | integer | |
Результат | boolean |
public getBasketElementManager ( ) : Sonata\Component\Basket\BasketElementManagerInterface | ||
Результат | Sonata\Component\Basket\BasketElementManagerInterface |
public getCheapestEnabledVariation ( Sonata\Component\Product\ProductInterface $product ) | ||
$product | Sonata\Component\Product\ProductInterface |
public getCurrencyPriceCalculator ( ) : Sonata\Component\Currency\CurrencyPriceCalculatorInterface | ||
Результат | Sonata\Component\Currency\CurrencyPriceCalculatorInterface |
public getEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
$product | Sonata\Component\Product\ProductInterface |
public getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface | ||
Результат | Symfony\Component\EventDispatcher\EventDispatcherInterface |
protected getMergedFields ( array $fields ) : array | ||
$fields | array | |
Результат | array |
public getProductFromRaw ( Sonata\Component\Order\OrderElementInterface $orderElement, string $type, string $format = 'json' ) : Sonata\Component\Product\ProductInterface | ||
$orderElement | Sonata\Component\Order\OrderElementInterface | |
$type | string | |
$format | string | |
Результат | Sonata\Component\Product\ProductInterface |
public getRawProduct ( Sonata\Component\Product\ProductInterface $product, string $format = 'json' ) : array | ||
$product | Sonata\Component\Product\ProductInterface | |
$format | string | |
Результат | array |
public getStockAvailable ( Sonata\Component\Product\ProductInterface $product ) | ||
$product | Sonata\Component\Product\ProductInterface |
public getVariatedProperties ( Sonata\Component\Product\ProductInterface $product, array $fields = [] ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$fields | array |
public getVariation ( Sonata\Component\Product\ProductInterface $product, array $choices = [] ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$choices | array |
public getVariationsChoices ( Sonata\Component\Product\ProductInterface $product, array $fields = [] ) | ||
$product | Sonata\Component\Product\ProductInterface | |
$fields | array |
public hasEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
$product | Sonata\Component\Product\ProductInterface |
public hasVariationFields ( ) : boolean | ||
Результат | boolean | return true if the product haas some variation fields |
public hasVariations ( Sonata\Component\Product\ProductInterface $product ) | ||
$product | Sonata\Component\Product\ProductInterface |
public isAddableToBasket ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Product\ProductInterface $product, array $options = [] ) : boolean | ||
$basket | Sonata\Component\Basket\BasketInterface | |
$product | Sonata\Component\Product\ProductInterface | |
$options | array | |
Результат | boolean |
public isValidBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement ) : boolean | ||
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
Результат | boolean | true if the basket element is still valid |
public isVariateBy ( $name ) : boolean | ||
$name | ||
Результат | boolean | return true if the field $name is a variation |
public reloadProduct ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | ||
$product | Sonata\Component\Product\ProductInterface | |
Результат | Sonata\Component\Product\ProductInterface |
public setBasketElementManager ( Sonata\Component\Basket\BasketElementManagerInterface $basketElementManager ) | ||
$basketElementManager | Sonata\Component\Basket\BasketElementManagerInterface |
public setCurrencyPriceCalculator ( Sonata\Component\Currency\CurrencyPriceCalculatorInterface $currencyPriceCalculator ) | ||
$currencyPriceCalculator | Sonata\Component\Currency\CurrencyPriceCalculatorInterface |
public setEventDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) | ||
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface |
public setOrderElementClassName ( string $orderElementClassName ) | ||
$orderElementClassName | string |
public setProductCategoryManager ( Sonata\Component\Product\ProductCategoryManagerInterface $productCategoryManager ) | ||
$productCategoryManager | Sonata\Component\Product\ProductCategoryManagerInterface |
public setProductCollectionManager ( Sonata\Component\Product\ProductCollectionManagerInterface $productCollectionManager ) | ||
$productCollectionManager | Sonata\Component\Product\ProductCollectionManagerInterface |
public synchronizeVariations ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public synchronizeVariationsCategories ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public synchronizeVariationsCollections ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public synchronizeVariationsDeliveries ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public synchronizeVariationsPackages ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public synchronizeVariationsProduct ( Sonata\Component\Product\ProductInterface $product, |
||
$product | Sonata\Component\Product\ProductInterface | |
$variations |
public updateComputationPricesFields ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product ) | ||
$basket | Sonata\Component\Basket\BasketInterface | |
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
$product | Sonata\Component\Product\ProductInterface |
public updateStock ( $product, Sonata\Component\Product\ProductManagerInterface $productManager, $diff ) | ||
$productManager | Sonata\Component\Product\ProductManagerInterface |
public validateFormBasketElement ( Sonata\CoreBundle\Validator\ErrorElement $errorElement, Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Basket\BasketInterface $basket ) | ||
$errorElement | Sonata\CoreBundle\Validator\ErrorElement | |
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
$basket | Sonata\Component\Basket\BasketInterface |
protected BasketElementManagerInterface,Sonata\Component\Basket $basketElementManager | ||
Результат | Sonata\Component\Basket\BasketElementManagerInterface |
protected CurrencyPriceCalculatorInterface,Sonata\Component\Currency $currencyPriceCalculator | ||
Результат | Sonata\Component\Currency\CurrencyPriceCalculatorInterface |
protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher | ||
Результат | Symfony\Component\EventDispatcher\EventDispatcherInterface |
protected ProductCategoryManagerInterface,Sonata\Component\Product $productCategoryManager | ||
Результат | Sonata\Component\Product\ProductCategoryManagerInterface |
protected ProductCollectionManagerInterface,Sonata\Component\Product $productCollectionManager | ||
Результат | Sonata\Component\Product\ProductCollectionManagerInterface |
protected SerializerInterface,JMS\Serializer $serializer | ||
Результат | JMS\Serializer\SerializerInterface |