swipestripe
[ class tree: swipestripe ] [ index: swipestripe ] [ all elements ]

Class: StockField

Source Location: /code/form/StockField.php

Class Overview

FormField
   |
   --StockField

Stock field for displaying and editing stock levels for Products and Variations. The value for this field is represented in the NumericField stockLevelField.


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (c) 2011, Frank Mullenger

Variables

Methods



Class Details

[line 17]
Stock field for displaying and editing stock levels for Products and Variations. The value for this field is represented in the NumericField stockLevelField.

Unlimited stock has a value of -1 Out of stock has a value of 0 Other values > 0 are the actual stock level




Tags:

author:  Frank Mullenger <frankmullenger@gmail.com>
version:  1.0
copyright:  Copyright (c) 2011, Frank Mullenger


[ Top ]


Class Variables

$stockChoiceField =

[line 31]

OptionSetField for unlimited/limited stock level.



Tags:

access:  protected

Type:   OptionSetField


[ Top ]

$stockLevelField =

[line 38]

NumericField for specifying limited stock level.



Tags:

access:  protected

Type:   NumericField


[ Top ]

$template =  "StockField"

[line 24]

Template filename



Tags:

access:  protected

Type:   String


[ Top ]



Class Methods


constructor __construct [line 50]

StockField __construct( String $name, [String $title = null], [String $value = ""], Product|Variation $object, [String $maxLength = null], [String $form = null])

Create an OptionSetField and NumericField.



Parameters:

String   $name  
String   $title  
String   $value  
Product|Variation   $object   Object this stock level is for
String   $maxLength  
String   $form  

[ Top ]

method Field [line 76]

String Field( )

Create the field for display in CMS.

(non-PHPdoc)




[ Top ]

method FieldHolder [line 105]

String FieldHolder( )

Render the fields and include javascript.

(non-PHPdoc)




[ Top ]

method setValue [line 121]

StockField setValue( $value)

Set value of the NumericField because that is the actual value of the stock level. If unlimited stock is selected the value is -1.

(non-PHPdoc)




Parameters:

   $value  

[ Top ]

method StockChoiceField [line 91]

String StockChoiceField( )

Retrieve the OptionsetField for stock choice for display in CMS.



[ Top ]

method validate [line 146]

Boolean validate( $validator)

Validate that the stock level is numeric and greater than -2.

-1 represents unlimited stock.




Parameters:

   $validator  

[ Top ]

method Value [line 134]

Int Value( )

Get the value of the stock level

(non-PHPdoc)




[ Top ]


Documentation generated on Thu, 08 Mar 2012 16:47:29 +1300 by phpDocumentor 1.4.4