function _updateIndexRecordById($id, $content, $title)
 {
     $query = new lmbUpdateQuery(FULL_TEXT_SEARCH_INDEXER_TABLE, $this->conn);
     $query->addField('content', $content);
     $query->addField('last_modified', time());
     $query->addField('title', $title);
     $query->addCriteria(new lmbSQLFieldCriteria('id', $id));
     $stmt = $query->getStatement();
     $stmt->execute();
 }
Exemplo n.º 2
0
 function testChaining()
 {
     $startId = $this->db->insert('test_db_table', array('description' => ''));
     $this->db->insert('test_db_table', array('description' => ''));
     $description = 'Some description';
     $title = 'Some title';
     $query = new lmbUpdateQuery('test_db_table', $this->conn);
     $query->set(array('description' => $description))->field('title', $title)->where($this->conn->quoteIdentifier('id') . '=' . intval($startId + 1))->execute();
     $rs = $this->db->select('test_db_table');
     $rs->rewind();
     $record = $rs->current();
     //this one is not changed
     $this->assertEqual($record->get('id'), $startId);
     $this->assertEqual($record->get('title'), '');
     $this->assertEqual($record->get('description'), '');
     $rs->next();
     $record = $rs->current();
     //$this->assertEqual($record->get('id'), $startId + 11);
     $this->assertEqual($record->get('title'), $title);
     $this->assertEqual($record->get('description'), $description);
 }
Exemplo n.º 3
0
 function update($table, $values, $criteria = null)
 {
     $query = new lmbUpdateQuery($table, $this->conn);
     if ($criteria) {
         $query->addCriteria(lmbSQLCriteria::objectify($criteria));
     }
     foreach ($values as $key => $value) {
         $query->addField($key, $value);
     }
     $this->stmt = $query->getStatement($this->conn);
     $this->stmt->execute();
     return $this;
 }
Exemplo n.º 4
0
 function update($set, $criteria = null)
 {
     if (is_array($set)) {
         $set = $this->_filterRow($set);
     }
     $query = new lmbUpdateQuery($this->_db_table_name, $this->_conn);
     if ($criteria) {
         $query->addCriteria($criteria);
     }
     if (is_array($set)) {
         foreach (array_keys($set) as $key) {
             $query->addField($key);
         }
         $this->_stmt = $query->getStatement();
         $this->_bindValuesToStatement($this->_stmt, $set);
         return $this->_stmt->execute();
     } else {
         $query->addRawField($set);
         $this->_stmt = $query->getStatement();
         return $this->_stmt->execute();
     }
 }