Esempio n. 1
0
 /**
  * Creates a query to rollback a previously started transaction.
  * @method update
  * @param {array} $criteria The criteria to use, for sharding
  * @return {Db_Query_Mysql} The resulting Db_Query object
  */
 function rollback($criteria = null)
 {
     $query = new Db_Query_Mysql($this, Db_Query::TYPE_ROLLBACK, array('ROLLBACK' => true));
     $query->rollback($criteria);
     return $query;
 }
Esempio n. 2
0
 /**
  * Creates a query to select fields from a table. Needs to be used with {@link Db_Query::from()}.
  *
  * @param string|array $fields 
  *  The fields as strings, or array of alias=>field
  * @param string|array $tables
  *  The tables as strings, or array of alias=>table
  * @return Db_Query_Mysql
  *  The resulting Db_Query object
  */
 function select($fields, $tables)
 {
     if (empty($fields)) {
         throw new Exception("Fields not specified in call to 'select'.");
     }
     if (empty($tables)) {
         throw new Exception("Tables not specified in call to 'select'.");
     }
     $query = new Db_Query_Mysql($this, Db_Query::TYPE_SELECT);
     return $query->select($fields, $tables);
 }