From 3880b89242f2c92c3e51aeafc4e24e6d95bb8e03 Mon Sep 17 00:00:00 2001 From: Sergey Shlokov Date: Fri, 23 Jun 2017 10:24:16 +0300 Subject: [PATCH] customize the available sql operators --- src/xPDO/Om/xPDOQuery.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xPDO/Om/xPDOQuery.php b/src/xPDO/Om/xPDOQuery.php index 5936ca61..36c0fca1 100644 --- a/src/xPDO/Om/xPDOQuery.php +++ b/src/xPDO/Om/xPDOQuery.php @@ -134,6 +134,12 @@ public function __construct(& $xpdo, $class, $criteria= null) { } } } + if ($operators = json_decode($this->xpdo->getOption('allowed_sql_operators', null, ''))) { + if (is_array($operators)) $this->_operators = array_unique(array_merge($this->_operators, $operators)); + } + if ($operators = json_decode($this->xpdo->getOption('denied_sql_operators', null, ''))) { + if (is_array($operators)) $this->_operators = array_diff($this->_operators, $operators); + } } /**