Commit 3d57852d authored by alexpott's avatar alexpott

Issue #2311885 by drunken monkey: Methods in Select missing from SelectInterface

parent 7bb4e4d1
......@@ -333,40 +333,21 @@ public function havingCondition($field, $value = NULL, $operator = NULL) {
}
/**
* Gets a list of all conditions in the HAVING clause.
*
* This method returns by reference. That allows alter hooks to access the
* data structure directly and manipulate it before it gets compiled.
*
* @return array
* An array of conditions.
*
* @see \Drupal\Core\Database\Query\ConditionInterface::conditions()
* {@inheritdoc}
*/
public function &havingConditions() {
return $this->having->conditions();
}
/**
* Gets a list of all values to insert into the HAVING clause.
*
* @return array
* An associative array of placeholders and values.
* {@inheritdoc}
*/
public function havingArguments() {
return $this->having->arguments();
}
/**
* Adds an arbitrary HAVING clause to the query.
*
* @param $snippet
* A portion of a HAVING clause as a prepared statement. It must use named
* placeholders, not ? placeholders.
* @param $args
* (optional) An associative array of arguments.
*
* @return $this
* {@inheritdoc}
*/
public function having($snippet, $args = array()) {
$this->having->where($snippet, $args);
......@@ -374,10 +355,7 @@ public function having($snippet, $args = array()) {
}
/**
* Compiles the HAVING clause for later retrieval.
*
* @param $connection
* The database connection for which to compile the clause.
* {@inheritdoc}
*/
public function havingCompile(Connection $connection) {
$this->having->compile($connection, $this);
......@@ -395,12 +373,7 @@ public function extend($extender_name) {
}
/**
* Sets a condition in the HAVING clause that the specified field be NULL.
*
* @param $field
* The name of the field to check.
*
* @return $this
* {@inheritdoc}
*/
public function havingIsNull($field) {
$this->having->isNull($field);
......@@ -408,12 +381,7 @@ public function havingIsNull($field) {
}
/**
* Sets a condition in the HAVING clause that the specified field be NOT NULL.
*
* @param $field
* The name of the field to check.
*
* @return $this
* {@inheritdoc}
*/
public function havingIsNotNull($field) {
$this->having->isNotNull($field);
......@@ -421,12 +389,7 @@ public function havingIsNotNull($field) {
}
/**
* Sets a HAVING condition that the specified subquery returns values.
*
* @param \Drupal\Core\Database\Query\SelectInterface $select
* The subquery that must contain results.
*
* @return $this
* {@inheritdoc}
*/
public function havingExists(SelectInterface $select) {
$this->having->exists($select);
......@@ -434,12 +397,7 @@ public function havingExists(SelectInterface $select) {
}
/**
* Sets a HAVING condition that the specified subquery returns no values.
*
* @param \Drupal\Core\Database\Query\SelectInterface $select
* The subquery that must contain results.
*
* @return $this
* {@inheritdoc}
*/
public function havingNotExists(SelectInterface $select) {
$this->having->notExists($select);
......
......@@ -138,6 +138,38 @@ public function havingCompile(Connection $connection) {
return $this->query->havingCompile($connection);
}
/**
* {@inheritdoc}
*/
public function havingIsNull($field) {
$this->query->havingIsNull($field);
return $this;
}
/**
* {@inheritdoc}
*/
public function havingIsNotNull($field) {
$this->query->havingIsNotNull($field);
return $this;
}
/**
* {@inheritdoc}
*/
public function havingExists(SelectInterface $select) {
$this->query->havingExists($select);
return $this;
}
/**
* {@inheritdoc}
*/
public function havingNotExists(SelectInterface $select) {
$this->query->havingNotExists($select);
return $this;
}
/* Implementations of Drupal\Core\Database\Query\ExtendableInterface. */
public function extend($extender_name) {
......
......@@ -7,6 +7,8 @@
namespace Drupal\Core\Database\Query;
use Drupal\Core\Database\Connection;
/**
* Interface definition for a Select Query object.
*
......@@ -524,6 +526,88 @@ public function execute();
*/
public function havingCondition($field, $value = NULL, $operator = NULL);
/**
* Gets a list of all conditions in the HAVING clause.
*
* This method returns by reference. That allows alter hooks to access the
* data structure directly and manipulate it before it gets compiled.
*
* @return array
* An array of conditions.
*
* @see \Drupal\Core\Database\Query\ConditionInterface::conditions()
*/
public function &havingConditions();
/**
* Gets a list of all values to insert into the HAVING clause.
*
* @return array
* An associative array of placeholders and values.
*/
public function havingArguments();
/**
* Adds an arbitrary HAVING clause to the query.
*
* @param $snippet
* A portion of a HAVING clause as a prepared statement. It must use named
* placeholders, not ? placeholders.
* @param $args
* (optional) An associative array of arguments.
*
* @return $this
*/
public function having($snippet, $args = array());
/**
* Compiles the HAVING clause for later retrieval.
*
* @param $connection
* The database connection for which to compile the clause.
*/
public function havingCompile(Connection $connection);
/**
* Sets a condition in the HAVING clause that the specified field be NULL.
*
* @param $field
* The name of the field to check.
*
* @return $this
*/
public function havingIsNull($field);
/**
* Sets a condition in the HAVING clause that the specified field be NOT NULL.
*
* @param $field
* The name of the field to check.
*
* @return $this
*/
public function havingIsNotNull($field);
/**
* Sets a HAVING condition that the specified subquery returns values.
*
* @param \Drupal\Core\Database\Query\SelectInterface $select
* The subquery that must contain results.
*
* @return $this
*/
public function havingExists(SelectInterface $select);
/**
* Sets a HAVING condition that the specified subquery returns no values.
*
* @param \Drupal\Core\Database\Query\SelectInterface $select
* The subquery that must contain results.
*
* @return $this
*/
public function havingNotExists(SelectInterface $select);
/**
* Clone magic method.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment