/** * @brief Constructor * * @note It's allowed to create an object with the ID 0 (for the root element). * * @param Database &$database reference to the Database-object * @param User &$current_user reference to the current user which is logged in * @param Log &$log reference to the Log-object * @param integer $id ID of the storelocation we want to get * * @throws Exception if there is no such storelocation in the database * @throws Exception if there was an error */ public function __construct(&$database, &$current_user, &$log, $id) { parent::__construct($database, $current_user, $log, 'storelocations', $id); if ($id == 0) { // this is the root node $this->db_data['is_full'] = false; return; } }
/** * @brief Constructor * * @note It's allowed to create an object with the ID 0 (for the root element). * * @param Database &$database reference to the Database-object * @param User &$current_user reference to the current user which is logged in * @param Log &$log reference to the Log-object * @param integer $id ID of the footprint we want to get * * @throws Exception if there is no such footprint * @throws Exception if there was an error */ public function __construct(&$database, &$current_user, &$log, $id) { parent::__construct($database, $current_user, $log, 'footprints', $id); if ($id == 0) { // this is the root node $this->db_data['filename'] = ''; return; } }
/** * @brief Constructor * * @note It's allowed to create an object with the ID 0 (for the root element). * * @param Database &$database reference to the Database-object * @param User &$current_user reference to the current user which is logged in * @param Log &$log reference to the Log-object * @param integer $id ID of the device we want to get * * @throws Exception if there is no such device in the database * @throws Exception if there was an error */ public function __construct(&$database, &$current_user, &$log, $id) { parent::__construct($database, $current_user, $log, 'devices', $id); if ($id == 0) { // this is the root node $this->db_data['order_quantity'] = 0; $this->db_data['order_only_missing_parts'] = false; } }
/** * @brief Constructor * * @note It's allowed to create an object with the ID 0 (for the root element). * * @param Database &$database reference to the Database-object * @param User &$current_user reference to the current user which is logged in * @param Log &$log reference to the Log-object * @param string $tablename the name of the database table (e.g. "suppliers" or "manufacturers") * @param integer $id ID of the database record we want to get * * @throws Exception if there is no such element in the database * @throws Exception if there was an error */ public function __construct(&$database, &$current_user, &$log, $tablename, $id) { parent::__construct($database, $current_user, $log, $tablename, $id); if ($id == 0) { // this is the root node $this->db_data['address'] = ''; $this->db_data['phone_number'] = ''; $this->db_data['fax_number'] = ''; $this->db_data['email_address'] = ''; $this->db_data['website'] = ''; return; } }
/** * @brief Constructor * * @note It's allowed to create an object with the ID 0 (for the root element). * * @param Database &$database reference to the Database-object * @param User &$current_user reference to the current user which is logged in * @param Log &$log reference to the Log-object * @param integer $id ID of the category we want to get * * @throws Exception if there is no such category in the database * @throws Exception if there was an error */ public function __construct(&$database, &$current_user, &$log, $id) { parent::__construct($database, $current_user, $log, 'categories', $id); }