Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
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
mongo-php-library
Commits
a9513dce
Unverified
Commit
a9513dce
authored
Jul 23, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract is_in_transaction helper from Collection class
parent
b356e8ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
40 deletions
+42
-40
Collection.php
src/Collection.php
+26
-40
functions.php
src/functions.php
+16
-0
No files found.
src/Collection.php
View file @
a9513dce
This diff is collapsed.
Click to expand it.
src/functions.php
View file @
a9513dce
...
@@ -110,6 +110,22 @@ function is_first_key_operator($document)
...
@@ -110,6 +110,22 @@ function is_first_key_operator($document)
return
(
isset
(
$firstKey
[
0
])
&&
$firstKey
[
0
]
===
'$'
);
return
(
isset
(
$firstKey
[
0
])
&&
$firstKey
[
0
]
===
'$'
);
}
}
/**
* Returns whether we are currently in a transaction.
*
* @internal
* @param array $options Command options
* @return boolean
*/
function
is_in_transaction
(
array
$options
)
{
if
(
isset
(
$options
[
'session'
])
&&
$options
[
'session'
]
instanceof
\MongoDB\Driver\Session
&&
$options
[
'session'
]
->
isInTransaction
())
{
return
true
;
}
return
false
;
}
/**
/**
* Return whether the aggregation pipeline ends with an $out operator.
* Return whether the aggregation pipeline ends with an $out operator.
*
*
...
...
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