Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
8646f286
Commit
8646f286
authored
Jun 5, 2013
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2002270
by phenaproxima, zschmid, vito_a | benjifisher: Remove views method add_having().
parent
6952fa75
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
+0
-44
0 additions, 44 deletions
...modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
with
0 additions
and
44 deletions
core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
+
0
−
44
View file @
8646f286
...
...
@@ -891,50 +891,6 @@ function add_where_expression($group, $snippet, $args = array()) {
);
}
/**
* Add a simple HAVING clause to the query.
*
* The caller is responsible for ensuring that all fields are fully qualified
* (TABLE.FIELD) and that the table and an appropriate GROUP BY already exist in the query.
* Internally the dbtng method "havingCondition" is used.
*
* @param $group
* The HAVING group to add these to; groups are used to create AND/OR
* sections. Groups cannot be nested. Use 0 as the default group.
* If the group does not yet exist it will be created as an AND group.
* @param $field
* The name of the field to check.
* @param $value
* The value to test the field against. In most cases, this is a scalar. For more
* complex options, it is an array. The meaning of each element in the array is
* dependent on the $operator.
* @param $operator
* The comparison operator, such as =, <, or >=. It also accepts more complex
* options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array
* = otherwise. If $field is a string you have to use 'formula' here.
*
* @see SelectQueryInterface::havingCondition()
*/
function
add_having
(
$group
,
$field
,
$value
=
NULL
,
$operator
=
NULL
)
{
// Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
// the default group.
if
(
empty
(
$group
))
{
$group
=
0
;
}
// Check for a group.
if
(
!
isset
(
$this
->
having
[
$group
]))
{
$this
->
set_where_group
(
'AND'
,
$group
,
'having'
);
}
// Add the clause and the args.
$this
->
having
[
$group
][
'conditions'
][]
=
array
(
'field'
=>
$field
,
'value'
=>
$value
,
'operator'
=>
$operator
,
);
}
/**
* Add a complex HAVING clause to the query.
* The caller is responsible for ensuring that all fields are fully qualified
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment