コード例 #1
0
ファイル: Delete.php プロジェクト: nstielau/drops-8
 /**
  * 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');
 }
コード例 #2
0
ファイル: Insert.php プロジェクト: sojo/d8_friendsofsilence
 /**
  * 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;
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
ファイル: Upsert.php プロジェクト: 318io/318-io
 /**
  * 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;
 }