Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A small suggestion WHERE conditions #24

Open
psad73 opened this issue Jan 6, 2022 · 0 comments
Open

A small suggestion WHERE conditions #24

psad73 opened this issue Jan 6, 2022 · 0 comments
Assignees

Comments

@psad73
Copy link

psad73 commented Jan 6, 2022

# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/<html>Entities.php (<b>1 gru 2021, 13:09:39</b>)</html>
+++ b/<html><b>Current File</b></html>
@@ -276,8 +276,14 @@
 
         if (!empty($params)) {
             foreach ($params as $param => $value) {
+                if (is_array($value)) {
+                    $op = $value[0];
+                    $val = $value[1];
+                    $criteria[] = "{$param} {$op} '{$val}'";
+                } else {
                 $criteria[] = "{$param} LIKE '{$value}'";
             }
+            }
 
             $query .= sprintf(' WHERE %s', implode(" AND ", $criteria));
         }

this may be usefull. It allows to specify more precise WHERE conditions for queries. Example:

$vtigerClient->entities->findMany('HelpDesk', ['createdtime ' => ['>', '2020-01-01'], 'createdtime' => ['<', '2020-04-16']]);

This will look for tickets created between given dates.

@salaros salaros self-assigned this Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants