setDBO(VoxelCareDB::getDatabase()); }//function function SetId($id) { $this->_id = (int)$id; $this->_item = null; } function store(&$data) { $table =& $this->getTable('deliverynote'); $db =& $this->_db; $table->reset(); $id = (int)$data['id']; $table->load($id); if (!$table->bind($data)) return false; if (!$table->check()) return false; if (!$table->store(true)) return false; $this->SetId($table->id); $data['id'] = $this->_id; return true; } function getData() { if (empty($this->_item)) { $db =& $this->_db; $sql = "SELECT dn.id, dn.concept concept, dn.price price, dn.vat vat, dn.batch batch, dn.total total, dn.amount amount, dn.userid userid, dn.paid paid FROM #__vxc_deliverynote dn WHERE dn.id = ".$this->_id; $db->setQuery($sql); $row = $db->loadObject(); if (!$row) { $row = new stdClass(); $row->id = 0; } $this->_item = $row; } return $this->_item; } }// class