PHP Class AddProductForm, silvershop-core

Inheritance: extends Form
Show file Open project: burnbright/silverstripe-shop Class Usage Examples

Protected Properties

Property Type Description
$maxquantity integer Populates quantity dropdown with this many values
$saveablefields array Fields that can be saved to an order item.

Public Methods

Method Description
__construct ( $controller, $name = "AddProductForm" )
addtocart ( $data, $form )
getBuyable ( $data = null )
setMaximumQuantity ( $qty ) Choose maximum value to populate quantity dropdown
setSaveableFields ( $fields )

Protected Methods

Method Description
getFormActions ( ) : FieldList
getFormFields ( ) : FieldList
getFormValidator ( ) : Validator

Method Details

__construct() public method

public __construct ( $controller, $name = "AddProductForm" )

addtocart() public method

public addtocart ( $data, $form )

getBuyable() public method

public getBuyable ( $data = null )

getFormActions() protected method

protected getFormActions ( ) : FieldList
return FieldList Actions for this form.

getFormFields() protected method

protected getFormFields ( ) : FieldList
return FieldList Fields for this form.

getFormValidator() protected method

protected getFormValidator ( ) : Validator
return Validator Validator for this form.

setMaximumQuantity() public method

Choose maximum value to populate quantity dropdown
public setMaximumQuantity ( $qty )

setSaveableFields() public method

public setSaveableFields ( $fields )

Property Details

$maxquantity protected property

Populates quantity dropdown with this many values
protected int $maxquantity
return integer

$saveablefields protected property

Fields that can be saved to an order item.
protected array $saveablefields
return array