Class TProductSlave

Description

Manage the product slaves

  • author: SimpliciWeb
  • version: $Id: t_productslave.class.php 732 2007-11-29 10:09:56Z stephanet $

Located in /core/internal_components/admin_sites/t_product/t_productslave.class.php (line 65)


	
			
Variable Summary
Method Summary
 bool checkSufficientStock (array $p_psl_id_list)
 bool decreaseStock (array $p_product_list)
 bool delete (integer $p_psl_id)
 bool deleteSupplierLink (integer $p_sup_id)
 bool deleteTPicture (integer $p_psl_id)
 bool get (integer $p_psl_id,  &$r_the_slave, array $r_the_slave)
 bool getCountActionMethodManual ( &$r_count_selected, integer $r_count_selected)
 bool getCountSelectedByPmaId (integer $p_pma_id, integegr $p_excluded_psl_id,  &$r_count_selected, integer $r_count_selected)
 bool getIdsByPslReference (string $p_psl_reference,  &$r_psl_id,  &$r_pma_id, integer $r_psl_id, integer $r_pma_id)
 bool getList (integer $p_pma_id,  &$r_the_slaves, array $r_the_slaves)
 bool getListPslIdPslReferencePmaTitleWithActionMethodManual ( &$r_array_psl_id, array $r_array_psl_id)
 bool increaseStock (array $p_product_list)
 bool insert (array $p_new_psl_img, integer $p_psl_pma_id, float $p_psl_tax_included_price, string $p_psl_reference, integer $p_psl_stock, float $p_psl_weight, string $p_psl_firstselected, float $p_psl_buying_price, string $p_pic_desc,  &$r_psl_id, [string $p_is_from_import = false], [integer $p_psl_sup_id = 0], [integer $p_psl_stock_alert = 0], integer $r_psl_id)
 bool isNotValidActionMethod (string $p_value)
 bool isNotValidBuyingPrice (string $p_value)
 bool isNotValidFirstSelected (string $p_value)
 bool isNotValidId (string $p_value)
 bool isNotValidReference (string $p_value)
 bool isNotValidStock (string $p_value)
 bool isNotValidTaxFreePrice (string $p_value)
 bool isNotValidWeight (string $p_value)
 bool update (array $p_new_psl_img, integer $p_psl_pma_id, integer $p_psl_id, array $p_array_db_values, [bool $p_is_from_import = false])
 bool validQuantity (array $p_psl_list,  &$r_result, bool $r_result)
 bool xGetAll ( &$r_the_slave_all, array $r_the_slave_all)
 bool xIsNotValidStockAlert (string $p_value)
 bool xIsUniqueReference (string $p_psl_reference,  &$r_bool_result, [integer $p_excluding_psl_id = 0], bool $r_bool_result)
 bool xUpdateStock (array $p_product_list, string $p_operation)
 bool xUpdateTPictureToZero (integer $p_psl_id, [integer $p_value = 0])
 bool _check ( &$r_resut_final, array $r_resut_final)
Variables
string $m_dynamique_part = "|DYN_REQU|" (line 72)

A marker to replace by parameters in requests

DbConnexion $m_object_dbconnexion = NULL (line 223)

Database Connexion object

Format $m_object_format = NULL (line 247)

Format Object

siteInformation $m_object_siteinformation = NULL (line 229)

SiteInformation Object

TAttribut $m_object_tattribut = NULL (line 241)

TAttribut Object

TAttributValue $m_object_tattributvalue = NULL (line 235)

TAttributValue Object

mixed $m_object_tpicture = NULL (line 251)
  • deprecated:
TProductMaster $m_object_tproductmaster = NULL (line 257)

TProductMaster

integer $m_undefined_stock_alert = 0 (line 270)

Value for stock alert if supplier are not defined

integer $m_undefined_supplier_id = 0 (line 264)

Value for supplier id if supplier are not defined

string $req_add_stock = "
UPDATE t_productslave
SET psl_stock = psl_stock+%d
WHERE psl_id = %d
AND psl_stock IS NOT NULL;"
(line 177)

SQL Request : Add stock

string $req_check_sufficient_stock = "" (line 216)

SQL Request : Check if we must send alert for low stock

string $req_count_manual = "select count(*) from t_productslave where psl_action_method='MANUAL';" (line 170)

SQL Request : Select count

string $req_count_reference = "select count(*) from t_productslave where psl_reference = '%s' and psl_id <> %d;" (line 158)

SQL Request : Count reference

string $req_count_selected_by_pma_id = "select count(*) from t_productslave where psl_pma_id = %d and psl_id <> %d and psl_firstselected = 'YES';" (line 164)

SQL Request : Select by product master id

string $req_delete = "delete from t_productslave where psl_id = %d;" (line 126)

SQL Request : Delete

string $req_delete_stock = "
UPDATE t_productslave
SET psl_stock = psl_stock-%d
WHERE psl_id = %d;"
(line 187)

SQL Request : Delete stock

string $req_delete_supplier =
"UPDATE t_productslave
SET psl_sup_id=%d,
psl_stock_alert = %d
WHERE psl_sup_id=%d;"
(line 205)

SQL Request : Delete all supplier information

string $req_get_stock = "
SELECT psl_id, psl_stock
FROM t_productslave
WHERE psl_id IN %s;"
(line 196)

SQL Request : Get stock

string $req_insert = "INSERT INTO t_productslave(psl_pic_id_little, psl_pic_id_medium, psl_pic_id_full, psl_pma_id, psl_tax_included_price, psl_reference, psl_stock, psl_weight, psl_firstselected, psl_buying_price, psl_sup_id, psl_stock_alert) VALUES(%d, %d, %d, %d, |psltaxincludedpricetype|, '%s', @@pslstock@@, %f, '%s', %f, %d, %d);" (line 78)

SQL Request : Insert

string $req_insert_from_import = "INSERT INTO t_productslave(psl_pic_id_little, psl_pic_id_medium, psl_pic_id_full, psl_pma_id, psl_tax_included_price, psl_reference, psl_stock, psl_weight, psl_firstselected, psl_buying_price, psl_action_method) VALUES(%d, %d, %d, %d, |psltaxincludedpricetype|, '%s', @@pslstock@@, %f, '%s', %f, 'IMPORT');" (line 84)

SQL Request : Insert from import

string $req_select = "select psl_id, psl_pic_id_little, psl_pic_id_medium, psl_pic_id_full, psl_pma_id, psl_tax_included_price, psl_reference, psl_weight, psl_firstselected, psl_buying_price from t_productslave where psl_id = %d;" (line 90)

SQL Request : Select

string $req_select_all = "select psl_id, psl_pic_id_little, psl_pic_id_medium, psl_pic_id_full, psl_pma_id, psl_tax_included_price, psl_reference, psl_weight, psl_firstselected, psl_buying_price from t_productslave ;" (line 96)

SQL Request : Select all

string $req_select_by_pma_id = "select psl_id, psl_pic_id_little, psl_pic_id_medium, psl_pic_id_full, psl_pma_id, psl_tax_included_price, psl_reference, psl_weight, psl_firstselected, psl_buying_price from t_productslave where psl_pma_id = %d;" (line 102)

SQL Request : Select by pma id

string $req_select_ids_by_psl_reference = "select psl_id, psl_pma_id from t_productslave where psl_reference ='%s';" (line 108)

SQL Request : Select by product slave reference

string $req_select_psl_id_action_method_manual = "" (line 120)

SQL Request : Select product slave by action method manual

string $req_select_stock = "SELECT psl_stock FROM t_productslave WHERE psl_id=%d;" (line 114)

SQL Request : Select stock

string $req_update = "update t_productslave set psl_pic_id_little=%d , psl_pic_id_medium=%d, psl_pic_id_full=%d, psl_pma_id=%d,
|DYN_REQU| where psl_id = %d;"
(line 132)

SQL Request : Update

string $req_update_from_import = "update t_productslave set psl_pic_id_little=%d , psl_pic_id_medium=%d, psl_pic_id_full=%d, psl_pma_id=%d, psl_action_method='IMPORT',
|DYN_REQU| where psl_id = %d;"
(line 139)

SQL Request : Update from input

string $req_update_to_action_method_manual = "update t_productslave set psl_action_method='MANUAL' where psl_action_method='IMPORT';" (line 152)

SQL Request : Update to action method manual

string $req_update_to_zero_pictures = "update t_productslave set psl_pic_id_little=%d , psl_pic_id_medium=0, psl_pic_id_full=0 where psl_id = %d ;" (line 146)

SQL Request : Update to zero pictures

Methods
Constructor TProductSlave (line 279)

Constructor, init the requests and objects

TProductSlave TProductSlave ()
checkSufficientStock (line 1806)

Probe to detect if stock are low for selected product slave

  • return: TRUE on error
bool checkSufficientStock (array $p_psl_id_list)
  • array $p_psl_id_list
decreaseStock (line 1661)

Delete stock for product

  • return: TRUE on error
bool decreaseStock (array $p_product_list)
  • array $p_product_list
delete (line 408)

Delete

  • return: TRUE on error
bool delete (integer $p_psl_id)
  • integer $p_psl_id
deleteSupplierLink (line 1995)

Delete all link with a specified supplier We replace supplier id by undefined supplier id

  • return: TRUE on error
bool deleteSupplierLink (integer $p_sup_id)
  • integer $p_sup_id
deleteTPicture (line 633)

Delete the picture of this slave

  • return: TRUE on error
bool deleteTPicture (integer $p_psl_id)
  • integer $p_psl_id
get (line 1255)

Get a slave

  • return: TRUE on error
bool get (integer $p_psl_id,  &$r_the_slave, array $r_the_slave)
  • integer $p_psl_id
  • array $r_the_slave
  • &$r_the_slave
getCountActionMethodManual (line 489)

Get count action with method manual

  • return: TRUE on error
bool getCountActionMethodManual ( &$r_count_selected, integer $r_count_selected)
  • integer $r_count_selected
  • &$r_count_selected
getCountSelectedByPmaId (line 454)

Get count selected by productm aster id

  • return: TRUE on error
bool getCountSelectedByPmaId (integer $p_pma_id, integegr $p_excluded_psl_id,  &$r_count_selected, integer $r_count_selected)
  • integer $p_pma_id
  • integegr $p_excluded_psl_id
  • integer $r_count_selected
  • &$r_count_selected
getIdsByPslReference (line 515)

Get list of id by reference

  • return: TRUE on error
bool getIdsByPslReference (string $p_psl_reference,  &$r_psl_id,  &$r_pma_id, integer $r_psl_id, integer $r_pma_id)
  • string $p_psl_reference
  • integer $r_psl_id
  • integer $r_pma_id
  • &$r_psl_id
  • &$r_pma_id
getList (line 590)

Get list

  • return: TRUE on error
bool getList (integer $p_pma_id,  &$r_the_slaves, array $r_the_slaves)
  • integer $p_pma_id
  • array $r_the_slaves
  • &$r_the_slaves
getListPslIdPslReferencePmaTitleWithActionMethodManual (line 549)

Get list of product salves with action method manual

  • return: TRUE on error
bool getListPslIdPslReferencePmaTitleWithActionMethodManual ( &$r_array_psl_id, array $r_array_psl_id)
  • array $r_array_psl_id
  • &$r_array_psl_id
increaseStock (line 1650)

Add stock for product

  • return: TRUE on error
bool increaseStock (array $p_product_list)
  • array $p_product_list
insert (line 750)

Insert a product slave

  • return: TRUE on error
bool insert (array $p_new_psl_img, integer $p_psl_pma_id, float $p_psl_tax_included_price, string $p_psl_reference, integer $p_psl_stock, float $p_psl_weight, string $p_psl_firstselected, float $p_psl_buying_price, string $p_pic_desc,  &$r_psl_id, [string $p_is_from_import = false], [integer $p_psl_sup_id = 0], [integer $p_psl_stock_alert = 0], integer $r_psl_id)
  • array $p_new_psl_img: $_FILES
  • integer $p_psl_pma_id
  • float $p_psl_tax_included_price
  • string $p_psl_reference
  • integer $p_psl_stock
  • float $p_psl_weight
  • string $p_psl_firstselected: 'Y','N'
  • float $p_psl_buying_price
  • string $p_pic_desc
  • integer $r_psl_id
  • string $p_is_from_import
  • integer $p_psl_sup_id
  • integer $p_psl_stock_alert
  • &$r_psl_id
insertOrUpdateSlaveTAttributTPictureFromPost (line 1339)

Insert or update a slave, attribut, picture from post

  • return: TRUE on error
bool insertOrUpdateSlaveTAttributTPictureFromPost ()
isNotValidActionMethod (line 387)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidActionMethod (string $p_value)
  • string $p_value
isNotValidBuyingPrice (line 377)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidBuyingPrice (string $p_value)
  • string $p_value
isNotValidFirstSelected (line 367)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidFirstSelected (string $p_value)
  • string $p_value
isNotValidId (line 316)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidId (string $p_value)
  • string $p_value
isNotValidReference (line 337)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidReference (string $p_value)
  • string $p_value
isNotValidStock (line 347)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidStock (string $p_value)
  • string $p_value
isNotValidTaxFreePrice (line 326)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidTaxFreePrice (string $p_value)
  • string $p_value
isNotValidWeight (line 357)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool isNotValidWeight (string $p_value)
  • string $p_value
update (line 920)

Update a product slave

  • return: TRUE on error
bool update (array $p_new_psl_img, integer $p_psl_pma_id, integer $p_psl_id, array $p_array_db_values, [bool $p_is_from_import = false])
  • array $p_new_psl_img: $_FILES
  • integer $p_psl_pma_id
  • integer $p_psl_id
  • array $p_array_db_values
  • bool $p_is_from_import
updateToActionMethodManual (line 576)

Update all products to method manual

  • return: TRUE on error
bool updateToActionMethodManual ()
validQuantity (line 1732)

Valid stock quantity

  • return: TRUE on error
bool validQuantity (array $p_psl_list,  &$r_result, bool $r_result)
  • array $p_psl_list
  • bool $r_result
  • &$r_result
xGetAll (line 1296)

Get all

  • return: TRUE on error
bool xGetAll ( &$r_the_slave_all, array $r_the_slave_all)
  • array $r_the_slave_all
  • &$r_the_slave_all
xIsNotValidStockAlert (line 397)

Parameter Integrity checker

  • return: TRUE if not valid
  • access: private
bool xIsNotValidStockAlert (string $p_value)
  • string $p_value
xIsUniqueReference (line 700)

Is unique reference

  • return: TRUE if it is unique
bool xIsUniqueReference (string $p_psl_reference,  &$r_bool_result, [integer $p_excluding_psl_id = 0], bool $r_bool_result)
  • string $p_psl_reference
  • bool $r_bool_result
  • integer $p_excluding_psl_id
  • &$r_bool_result
xUpdateStock (line 1673)

Update stock for a product slave list

  • return: TRUE on error
bool xUpdateStock (array $p_product_list, string $p_operation)
  • array $p_product_list
  • string $p_operation: 'DELETE','ADD'
xUpdateTPictureToZero (line 674)

Update the picture and set to zero

  • return: TRUE on error
bool xUpdateTPictureToZero (integer $p_psl_id, [integer $p_value = 0])
  • integer $p_psl_id
  • integer $p_value
_check (line 1581)

Check integrity

  • return: TRUE on error
bool _check ( &$r_resut_final, array $r_resut_final)
  • array $r_resut_final
  • &$r_resut_final

Documentation generated on Tue, 25 Mar 2008 15:37:14 +0100 by phpDocumentor 1.3.2