Source for file SHOP_ORDER.phpclass
Documentation is available at SHOP_ORDER.phpclass
* openCSP class file SHOP_ORDER.phpclass
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: SHOP_ORDER.phpclass,v 1.1 2008/10/16 02:21:48 pitlinz Exp $
// ---------------------------------------------------------
// ---------------------------------------------------------
* openCSP class SHOP_ORDER
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: SHOP_ORDER.phpclass,v 1.1 2008/10/16 02:21:48 pitlinz Exp $
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @constant string CLASS_SRC_FILE
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** class vars ------------------------------------------------------ */
protected static $loadedOrders =
array();
/*** class methods --------------------------------------------------- */
* returns an instance of the unit of work
if (!isset
(self::$loadedOrders[$aId]) ||
pcf_class_implements(self::$loadedOrders[$aId],'INFA_SHOP_ORDER'))
self::$loadedOrders[$aId] =
SHOP_ORDER::factoryFromId(intval($aId));
return self::$loadedOrders[$aId];
* returns if we already have an instance of $aId
if (isset
(self::$loadedOrders[$aId]))
return pcf_class_implements(self::$loadedOrders[$aId],'INFA_SHOP_ORDER');
* adds a newsletter to the unit of work
* @param SHOP_ORDER $aOrder
self::$loadedOrders[$aOrder->getId()] =
$aOrder;
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** compostion --------------------------------------------------- */
/*** attributes -------------------------------------------------- */
* populate timestamp of $this->myItems
* @var double $myItemsPopulateTS (timestamp)
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* returns a new order object
$obj_ret =
new SHOP_ORDER();
$obj_ret->populateFromKeys(array('ORD_ID' =>
intval($aId)));
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* inserts a new row to the table
* @param boolean $debug show debug info
* @returns int returns the autoIncFld ID if exists or 1 on success
$this->setDBField('ORD_CREATEDON','CURRENT_TIMESTAMP');
$this->setDBField('ORD_CREATEDIP',$_SERVER['REMOTE_ADDR']);
$this->setDBField('ORD_CREATEDSRV',$_SERVER['SERVER_NAME']);
$arr_data =
$obj_client->getDBVal();
$arr_data =
array_merge($obj_addr->getDBVal(),$arr_data);
foreach($this->myItems as &$obj_item)
$obj_item->setOrderId($int_id);
$obj_item->dbInsert($debug);
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
return $obj_user->getCliId();
* @param unknown_type $aId
* returns the invoice address id
return $obj_cli->getPriAddrId();
* returns the invoice address DB values
$str_val =
$this->getDBField('ORD_INV_ADDR_DATA');
return array('ADR_ID'=>
0,'CLI_ID'=>
$this->getClientId());
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* returns if $this->myItems is populated
* populates the order items into $this->myItems
* @return int (number of items loaded);
$arr_filter =
array('ORD_ID' =>
$this->getId());
foreach($arr_items as $arr_row)
* @param array $arr_attribs
* @todo check if part and attribs alread exists
public function &addItem($aPart,$quant,$arr_attribs=
Null)
$obj_item->setPart($aPart);
$obj_item->setAttributes($arr_attribs);
$this->myItems[$int_idx] =
$obj_item;
Documentation generated on Thu, 08 Jan 2009 17:48:31 +0100 by phpDocumentor 1.4.0a2