Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
8c17827d
Commit
8c17827d
authored
Oct 11, 2017
by
Jens Segers
Committed by
GitHub
Oct 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1320 from lindelius/master
Added support for "whereAll" queries
parents
b9d99c61
d887e4fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
Builder.php
src/Jenssegers/Mongodb/Query/Builder.php
+29
-0
No files found.
src/Jenssegers/Mongodb/Query/Builder.php
View file @
8c17827d
...
...
@@ -491,6 +491,24 @@ class Builder extends BaseBuilder
return
$this
;
}
/**
* Add a "where all" clause to the query.
*
* @param string $column
* @param array $values
* @param string $boolean
* @param bool $not
* @return $this
*/
public
function
whereAll
(
$column
,
array
$values
,
$boolean
=
'and'
,
$not
=
false
)
{
$type
=
'all'
;
$this
->
wheres
[]
=
compact
(
'column'
,
'type'
,
'boolean'
,
'values'
,
'not'
);
return
$this
;
}
/**
* @inheritdoc
*/
...
...
@@ -923,6 +941,17 @@ class Builder extends BaseBuilder
return
$compiled
;
}
/**
* @param array $where
* @return array
*/
protected
function
compileWhereAll
(
array
$where
)
{
extract
(
$where
);
return
[
$column
=>
[
'$all'
=>
array_values
(
$values
)]];
}
/**
* @param array $where
* @return array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment