PHP Class Elcodi\Admin\ProductBundle\Controller\VariantController

Inheritance: extends Elcodi\Admin\CoreBundle\Controller\Abstracts\AbstractAdminController
Datei anzeigen Open project: elcodi/bamboo

Public Methods

Method Description
deleteAction ( Request $request, mixed $variant, string $redirectPath = null ) : RedirectResponse Delete element action
disableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array Disable entity
editAction ( Symfony\Component\Form\FormInterface $form, Elcodi\Component\Product\Entity\Interfaces\ProductInterface $product, Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant, boolean $isValid ) : RedirectResponse Edit and Saves product
enableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $variant ) : array Enable entity

Protected Methods

Method Description
getUniqueAttributesFromVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant ) : array Given a Variant, return a list of the associated Attributes

Method Details

deleteAction() public method

Delete element action
public deleteAction ( Request $request, mixed $variant, string $redirectPath = null ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request Request
$variant mixed Variant to delete
$redirectPath string Redirect path
return Symfony\Component\HttpFoundation\RedirectResponse Redirect response

disableAction() public method

Disable entity
public disableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $entity ) : array
$request Symfony\Component\HttpFoundation\Request Request
$entity Elcodi\Component\Core\Entity\Interfaces\EnabledInterface Entity to disable
return array Result

editAction() public method

Edit and Saves product
public editAction ( Symfony\Component\Form\FormInterface $form, Elcodi\Component\Product\Entity\Interfaces\ProductInterface $product, Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant, boolean $isValid ) : RedirectResponse
$form Symfony\Component\Form\FormInterface Form
$product Elcodi\Component\Product\Entity\Interfaces\ProductInterface Product
$variant Elcodi\Component\Product\Entity\Interfaces\VariantInterface Variant
$isValid boolean Is valid
return Symfony\Component\HttpFoundation\RedirectResponse Redirect response

enableAction() public method

Enable entity
public enableAction ( Request $request, Elcodi\Component\Core\Entity\Interfaces\EnabledInterface $variant ) : array
$request Symfony\Component\HttpFoundation\Request Request
$variant Elcodi\Component\Core\Entity\Interfaces\EnabledInterface Product variant to enable
return array Result

getUniqueAttributesFromVariant() protected method

The Attribute is fetched from the "options" relation. In theory each option in a Variant should belong to a different Attribute.
protected getUniqueAttributesFromVariant ( Elcodi\Component\Product\Entity\Interfaces\VariantInterface $variant ) : array
$variant Elcodi\Component\Product\Entity\Interfaces\VariantInterface
return array