diff --git a/src/SelectQuery.php b/src/SelectQuery.php index 95a5e5487c16bdb8d749e8c53a358ec9f3b3c600..86373b7f944e33e35bbaaee4c9557edf011cd298 100644 --- a/src/SelectQuery.php +++ b/src/SelectQuery.php @@ -59,11 +59,15 @@ class SelectQuery implements SelectQueryInterface { */ public function __construct($object_type = '') { $this->objectType = $object_type; + $this->conjunction = 'AND'; } /** * Add a condition to the query. * + * Conditions will be combined with the conjunction defined by + * $this->conjunction. Defaults to 'AND'. + * * @param string $field * Field name. * @param mixed $value @@ -100,6 +104,8 @@ class SelectQuery implements SelectQueryInterface { * Implements PHP's magic toString(). * * 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 * SOQL query ready to be executed the SF API. @@ -116,7 +122,7 @@ class SelectQuery implements SelectQueryInterface { foreach ($this->conditions as $condition) { $where[] = implode('+', $condition); } - $query .= '+WHERE+' . implode('+AND+', $where); + $query .= '+WHERE+' . implode('+' . $this->conjunction . '+', $where); } if ($this->order) {