Example #1
0
 function select($table, $criteria = null, $order = array())
 {
     $query = new lmbSelectQuery($table, $this->conn);
     if ($criteria) {
         $query->addCriteria(lmbSQLCriteria::objectify($criteria));
     }
     $rs = $query->getRecordSet();
     if (is_array($order) && sizeof($order)) {
         $rs->sort($order);
     }
     return $rs;
 }
 function testConstruct()
 {
     $sql = new lmbSelectQuery('foo');
     $this->assertEqual($sql->getTables(), array('foo'));
 }
 function findIndexRecordByUri($uri)
 {
     $query = new lmbSelectQuery(FULL_TEXT_SEARCH_INDEXER_TABLE, $this->conn);
     $query->addCriteria(new lmbSQLFieldCriteria('uri', $uri->toString()));
     $rs = $query->getRecordSet();
     $rs->rewind();
     if ($rs->valid()) {
         return $rs->current();
     }
 }
 function getSelectQuery($fields = array())
 {
     $query = new lmbSelectQuery($this->_db_table_name, $this->_conn);
     if (!$fields) {
         $fields = $this->getColumnsForSelect();
     }
     foreach ($fields as $field) {
         $query->addField($field);
     }
     return $query;
 }