CORE POS - Fannie
The CORE POS back end
Public Member Functions | Protected Attributes | List of all members
VendorItemsModel Class Reference
Inheritance diagram for VendorItemsModel:
BasicModel

Public Member Functions

 doc ()
 
 createIfMissing ($upc, $vendorID)
 
 updateCostByUPC ($upc, $cost, $vendorID)
 
 vendorItemID ()
 
 upc ()
 
 sku ()
 
 brand ()
 
 description ()
 
 size ()
 
 units ()
 
 cost ()
 
 saleCost ()
 
 vendorDept ()
 
 vendorID ()
 
- Public Member Functions inherited from BasicModel
 db ()
 
 preferredDB ()
 
 setConfig ($c)
 
 __construct ($con)
 
 whichDB ($db_name)
 
 getDefinition ()
 
 create ()
 
 createIfNeeded ($db_name)
 
 load ()
 
 reset ()
 
 getColumns ()
 
 getName ()
 
 getFullQualifiedName ()
 
 find ($sort='', $reverse=false)
 
 delete ()
 
 save ()
 
 pushToLanes ()
 
 deleteFromLanes ()
 
 normalize ($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK, $doCreate=False)
 
 doc ()
 
 generate ($filename)
 
 newModel ($name, $as_view=false)
 
 getModels ()
 
 toJSON ()
 

Protected Attributes

 $name = "vendorItems"
 
 $preferred_db = 'op'
 
 $columns
 
- Protected Attributes inherited from BasicModel
 $name
 
 $fq_name
 
 $columns = array()
 
 $unique = array()
 
 $meta_types
 
 $connection = false
 
 $record_changed = false
 
 $instance = array()
 
 $filters = array()
 
 $normalize_lanes = false
 
 $currently_normalizing_lane = false
 
 $cached_definition = false
 
 $config
 
 $preferred_db = ''
 
 $hooks = array()
 

Additional Inherited Members

- Public Attributes inherited from BasicModel
const NORMALIZE_MODE_CHECK = 1
 
const NORMALIZE_MODE_APPLY = 2
 
- Protected Member Functions inherited from BasicModel
 getMeta ($type, $dbms)
 
 validateOp ($operator)
 
 insertRecord ()
 
 updateRecord ()
 
 normalizeLanes ($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK, $doCreate=False)
 
 loadHooks ()
 

Member Function Documentation

VendorItemsModel::createIfMissing (   $upc,
  $vendorID 
)

Helper: create a vendorItems record for an existing product if one does not exist

VendorItemsModel::updateCostByUPC (   $upc,
  $cost,
  $vendorID 
)

Helper: update vendor costs when updating a product cost if the product has a defined vendor

Member Data Documentation

VendorItemsModel::$columns
protected
Initial value:
= array(
'vendorItemID' => array('type'=>'INT', 'index'=>true, 'increment'=>true),
'upc' => array('type'=>'VARCHAR(13)','index'=>True),
'sku' => array('type'=>'VARCHAR(13)','index'=>True,'primary_key'=>True),
'brand' => array('type'=>'VARCHAR(50)'),
'description' => array('type'=>'VARCHAR(50)'),
'size' => array('type'=>'VARCHAR(25)'),
'units' => array('type'=>'DOUBLE', 'default'=>1),
'cost' => array('type'=>'MONEY'),
'saleCost' => array('type'=>'MONEY', 'default'=>0),
'vendorDept' => array('type'=>'INT', 'default'=>0),
'vendorID' => array('type'=>'INT','index'=>True,'primary_key'=>True)
)

The documentation for this class was generated from the following file: