setDBO(VoxelCareDB::getDatabase()); }//function function SetId($id) { $this->_id = (int)$id; $this->_item = null; } function checkIfOrderAlreadyInSystem($orderId) { $orderId = (int)$orderId; if (!$orderId) return true; $sql = "SELECT orderid FROM #__vxc_pprsaplog WHERE result='S' AND orderid = ".$orderId; $this->_db->setQuery($sql); if ($this->_db->loadResult()) return true; else return false; } function store(&$data) { $table =& $this->getTable('pprsaplog'); $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 l.id id, l.invoker_user invoker_user, l.date_sent date_sent, l.orderid orderid, l.request request, l.answer answer FROM #__vxc_pprsaplog l WHERE l.id = ".$this->_id; $db->setQuery($sql); $row = $db->loadObject(); if (!$row) { $row = new stdClass(); $row->id = 0; } $this->_item = $row; } return $this->_item; } }// class