Source for file PRO_PART.phpclass
Documentation is available at PRO_PART.phpclass
* openCSP class file PRO_PART.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: PRO_PART.phpclass,v 1.7 2008/10/16 02:21:48 pitlinz Exp $
// ---------------------------------------------------------
// ---------------------------------------------------------
* @project Open CSP-Management
* @author Peter Krebs <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: PRO_PART.phpclass,v 1.7 2008/10/16 02:21:48 pitlinz Exp $
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* @constant string CLASS_SRC_FILE
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** class vars ------------------------------------------------------ */
private static $loadedParts =
array();
/*** class methods --------------------------------------------------- */
* returns an instance of a part
if ($debug) echoDebugMethod(__FILE__
,"static","PRO_PART::getInstance({$aId})");
if (!isset
(self::$loadedParts[intval($aId)]))
self::$loadedParts[intval($aId)] =
self::factoryFromId($aId,$debug);
return self::$loadedParts[intval($aId)];
* adds an instance to self::$loadedParts
public static function setInstance(&$aPart,$debug=
False)
self::$loadedParts[intval($aPart->getId())] =
$aPart;
* returns if a part has been added to the identity map
return isset
(self::$loadedParts[intval($aId)]);
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
/*** compostion --------------------------------------------------- */
/*** attributes -------------------------------------------------- */
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
public function setId($aId)
* returns the sort order number
* returns the available quantity of the part
* sets the available quantity of the part
* returns the price of the part
// -------------------------------------------------------
// db save methods (insert / replace (update) / delete)
// -------------------------------------------------------
* save the part to the database
* @param boolean $debug SHOW DEBUG INFO
public function dbSave($debug=
False)
* 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
$str_query =
"SELECT MAX(PAR_SORTORDER) FROM T_PRO_PART";
// -------------------------------------------------------
// -------------------------------------------------------
* returns the product group id
* retruns the product group
// -------------------------------------------------------
// -------------------------------------------------------
* sets the product object
* @param PRO_PRODUCT $aProduct
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
* returns if the part is online
$obj_date->setDbString($this->getDBField('PAR_SHOWFROM'));
if ($obj_date->isInFutur())
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"part will come in future");
$obj_date->setDbString($this->getDBField('PAR_SHOWTILL'));
if ($obj_date->isInPast())
if ($debug) echoDebugLine(__FILE__
,__LINE__
,"part is out of date");
* returns if the part is in a campain
Documentation generated on Thu, 08 Jan 2009 17:48:13 +0100 by phpDocumentor 1.4.0a2