Tutorial Extension  1.0.0
SellerDeck Extensions - Tutorial Extension
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CFieldMapping Class Reference

Public Member Functions

 __construct ($oCatalogDB, $oShippingDB)
 

Protected Member Functions

 MapOrders ($aGetOrdersResult)
 
 GenerateOrderNumber ($sExternalOrderID)
 
 GetProductByReference ($sProductReference)
 
 GetProductByBarcode ($sBarcode)
 
 GetProductPropertiesByBarcode ($sBarcode)
 

Protected Attributes

 $m_oTax = null
 
 $m_oValidator = null
 
 $m_oCatalogDB = null
 
 $m_oShippingDB = null
 
 $m_sCurrentDate = ""
 
 $m_dDefaultWeight = DEFAULT_WEIGHT
 

Detailed Description

Definition at line 14 of file CFieldMapping.php.

Constructor & Destructor Documentation

__construct (   $oCatalogDB,
  $oShippingDB 
)

__construct - Object constructor

public

Parameters
object$oCatalogDBCatalog DB
object$oShippingDBShipping DB
Returns
void

Definition at line 55 of file CFieldMapping.php.

56  {
57  $this->m_oValidator = new \SDExtension\Helper\CValidator($oCatalogDB, $oShippingDB);
58  $this->m_oTax = new \SDExtension\CTax($oCatalogDB, $oShippingDB);
59  $this->m_oCatalogDB = $oCatalogDB;
60  $this->m_oShippingDB = $oShippingDB;
61  $this->m_sCurrentDate = SellerDeckDate();
62  $oQueryResult = $this->m_oShippingDB->Select(TABLE_WEIGHT_CONFIGURATION, 'sDefaultWeight', [['nID', 0]]);
63  if ($oQueryResult !== false)
64  {
65  $aControlInfo = $oQueryResult->fetch(\PDO::FETCH_ASSOC);
66  $this->m_dDefaultWeight = (double) arr_get($aControlInfo, 'sDefaultWeight', DEFAULT_WEIGHT);
67  }
68  }

Member Function Documentation

GenerateOrderNumber (   $sExternalOrderID)
abstractprotected

MapOrders - Maps Orders

protected

Parameters
array$aGetOrdersResultGetOrders() Result
GetProductByBarcode (   $sBarcode)
protected

GetProductByBarcode - Getting Product by Barcode

protected

Parameters
string$sBarcodeBarcode
Returns
array Product

Definition at line 110 of file CFieldMapping.php.

111  {
112  $oQueryResult = $this->m_oCatalogDB->Select(TABLE_PRODUCT, ['Product Reference'], [['sBarcode', SQL_TYPE_STRING . $sBarcode]]);
113  if ($oQueryResult === false)
114  {
115  return [];
116  }
117  return $oQueryResult->fetch(\PDO::FETCH_ASSOC);
118  }
GetProductByReference (   $sProductReference)
protected

GetProductByReference - Getting Product by Reference

protected

Parameters
string$sProductReferenceProduct Reference
Returns
array Product

Definition at line 93 of file CFieldMapping.php.

94  {
95  $oQueryResult = $this->m_oCatalogDB->Select(TABLE_PRODUCT, '*', [['Product Reference', SQL_TYPE_STRING . $sProductReference]]);
96  if ($oQueryResult === false)
97  {
98  return [];
99  }
100  return $oQueryResult->fetch(\PDO::FETCH_ASSOC);
101  }
GetProductPropertiesByBarcode (   $sBarcode)
protected

GetProductPropertiesByBarcode - Getting Product Properties by Barcode

protected

Parameters
string$sBarcodeBarcode
Returns
array Product Properties

Definition at line 127 of file CFieldMapping.php.

128  {
129  $oQueryResult = $this->m_oCatalogDB->Select(TABLE_PRODUCT_PROPERTIES, '*', [['nType', 8], ['sString4', SQL_TYPE_STRING . $sBarcode]]);
130  if ($oQueryResult === false)
131  {
132  return [];
133  }
134  return $oQueryResult->fetch(\PDO::FETCH_ASSOC);
135  }
MapOrders (   $aGetOrdersResult)
abstractprotected

MapOrders - Maps Orders

protected

Parameters
array$aGetOrdersResultGetOrders() Result

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