Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
salesforce
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
salesforce
Commits
9aec10ee
Commit
9aec10ee
authored
1 year ago
by
Emircan ERKUL
Committed by
Aaron Bauman
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3410886
by emircanerkul, AaronBauman: Add option to SelectQuery condition
parent
8979e2b6
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SelectQuery.php
+7
-1
7 additions, 1 deletion
src/SelectQuery.php
with
7 additions
and
1 deletion
src/SelectQuery.php
+
7
−
1
View file @
9aec10ee
...
@@ -59,11 +59,15 @@ class SelectQuery implements SelectQueryInterface {
...
@@ -59,11 +59,15 @@ class SelectQuery implements SelectQueryInterface {
*/
*/
public
function
__construct
(
$object_type
=
''
)
{
public
function
__construct
(
$object_type
=
''
)
{
$this
->
objectType
=
$object_type
;
$this
->
objectType
=
$object_type
;
$this
->
conjunction
=
'AND'
;
}
}
/**
/**
* Add a condition to the query.
* Add a condition to the query.
*
*
* Conditions will be combined with the conjunction defined by
* $this->conjunction. Defaults to 'AND'.
*
* @param string $field
* @param string $field
* Field name.
* Field name.
* @param mixed $value
* @param mixed $value
...
@@ -100,6 +104,8 @@ class SelectQuery implements SelectQueryInterface {
...
@@ -100,6 +104,8 @@ class SelectQuery implements SelectQueryInterface {
* Implements PHP's magic toString().
* Implements PHP's magic toString().
*
*
* Function to convert the query to a string to pass to the SF API.
* Function to convert the query to a string to pass to the SF API.
* Conditions will be combined with the conjunction defined by
* $this->conjunction. Defaults to 'AND'.
*
*
* @return string
* @return string
* SOQL query ready to be executed the SF API.
* SOQL query ready to be executed the SF API.
...
@@ -116,7 +122,7 @@ class SelectQuery implements SelectQueryInterface {
...
@@ -116,7 +122,7 @@ class SelectQuery implements SelectQueryInterface {
foreach
(
$this
->
conditions
as
$condition
)
{
foreach
(
$this
->
conditions
as
$condition
)
{
$where
[]
=
implode
(
'+'
,
$condition
);
$where
[]
=
implode
(
'+'
,
$condition
);
}
}
$query
.
=
'+WHERE+'
.
implode
(
'+
AND
+'
,
$where
);
$query
.
=
'+WHERE+'
.
implode
(
'+
'
.
$this
->
conjunction
.
'
+'
,
$where
);
}
}
if
(
$this
->
order
)
{
if
(
$this
->
order
)
{
...
...
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