/** * Constructs a Delete object. * * @param \Drupal\Core\Database\Connection $connection * A Connection object. * @param string $table * Name of the table to associate with this query. * @param array $options * Array of database options. */ public function __construct(Connection $connection, $table, array $options = array()) { $options['return'] = Database::RETURN_AFFECTED; parent::__construct($connection, $options); $this->table = $table; $this->condition = new Condition('AND'); }
/** * Constructs an Insert object. * * @param \Drupal\Core\Database\Connection $connection * A Connection object. * @param string $table * Name of the table to associate with this query. * @param array $options * Array of database options. */ public function __construct($connection, $table, array $options = array()) { if (!isset($options['return'])) { $options['return'] = Database::RETURN_INSERT_ID; } parent::__construct($connection, $options); $this->table = $table; }
/** * Constructs a Select object. * * @param string $table * The name of the table that is being queried. * @param string $alias * The alias for the table. * @param \Drupal\Core\Database\Connection $connection * Database connection object. * @param array $options * Array of query options. */ public function __construct($table, $alias = NULL, Connection $connection, $options = array()) { $options['return'] = Database::RETURN_STATEMENT; parent::__construct($connection, $options); $conjunction = isset($options['conjunction']) ? $options['conjunction'] : 'AND'; $this->where = new Condition($conjunction); $this->having = new Condition($conjunction); $this->addJoin(NULL, $table, $alias); }
/** * Constructs an Upsert object. * * @param \Drupal\Core\Database\Connection $connection * A Connection object. * @param string $table * Name of the table to associate with this query. * @param array $options * (optional) An array of database options. */ public function __construct(Connection $connection, $table, array $options = []) { $options['return'] = Database::RETURN_AFFECTED; parent::__construct($connection, $options); $this->table = $table; }