/** * Constructor of INSERT query. * WARNING: INSERT can be applied only to the single table. You can use array as the first parameter of constructor, but it should be array of 1 element * * @param mixed $tables * @param bool $on_duplicate_update * @throws InvalidArgumentException */ public function __construct($tables, $on_duplicate_update = false) { parent::__construct($tables); if (count($this->from) != 1) { throw new InvalidArgumentException('INSERT can be used only on the single table'); } $this->on_duplicate_update = $on_duplicate_update; }
public function __construct($tables, array $del_tables = array(0)) { parent::__construct($tables); $this->del_tables = $del_tables; }
/** * Creates new UPDATE-query object. * By default, it is equivalent of "UPDATE t0, t1, t2, tN SET …", where t0-tN are tables given to this constructor * Be sure to specify some fields to be updated, or query will fail to be generated * * @param mixed $tables */ public function __construct($tables) { parent::__construct($tables); $this->set_fields = array(); $this->set_values = array(); }
/** * Creates new SELECT-query object. * By default, it is equivalent of "SELECT t0.* FROM t0, t1, t2, tN", where t0-tN are tables given to this constructor * * @param mixed $tables */ public function __construct($tables) { parent::__construct($tables); $this->setSelect(array(new AllFields())); }