Exemple #1
0
 public function drop()
 {
     $prim = self::$_primaryField;
     $preparedId = $this->_prepareValue(self::$_metadata[$prim], $this->_id);
     $sql = "DELETE FROM `{$this->_table}` WHERE `{$prim}` = {$preparedId} ";
     $res = $this->_db->executeNoresSQL($sql);
     if (!$res) {
         throw new ModelException("Invalid query - " . $this->_db->getError());
     }
     $this->_data = array();
     $this->_id = null;
 }
 public function pushMsg($desc, $detail, $type = MSG_SYSINFO)
 {
     $o_db = new DBAdapter(array('host' => $this->dbConf->crawler->host, 'username' => $this->dbConf->crawler->username, 'password' => $this->dbConf->crawler->password, 'schema' => $this->dbConf->crawler->schema, 'host' => $this->dbConf->crawler->host));
     $sql = "INSERT INTO " . $this->dbConf->crawler->schema . ".messages (m_description,m_detail) VALUES (";
     $sql .= "'" . $type . addslashes($desc) . "','" . addslashes($detail) . "')";
     //executeNoresSQL($query)
     $done = false;
     if (!$o_db->executeNoresSQL($sql)) {
         unset($o_db);
     } else {
         unset($o_db);
         $done = true;
     }
     return $done;
 }