- Work done on Ulmus which were added within the Bottin de suppléance app

This commit is contained in:
mcndave committed 2021-10-21 19:02:59 +00:00
1 parent 7fb591e1f5
commit 9ad2e94d12
9 files changed
+219 -127

No files matched your search

+5 -5
View File
@@ -2,8 +2,7 @@
namespace Ulmus\Query;
use Ulmus\Common\EntityField,
Ulmus\Common\Sql;
use Ulmus\Common\Sql;
class Where extends Fragment {
const OPERATOR_LIKE = "LIKE";
@@ -114,7 +113,7 @@ class Where extends Fragment {
}
# whitelisting operators
return in_array(strtoupper($this->operator), [ '=', '!=', '<>', 'LIKE', 'IS', 'IS NOT' ]) ? $this->operator : "=";
return in_array(strtoupper($this->operator), [ '=', '!=', '<>', '>', '<', '>=', '<=', 'LIKE', 'IS', 'IS NOT' ]) ? $this->operator : "=";
}
protected function value()
@@ -136,10 +135,11 @@ class Where extends Fragment {
{
if ( $value === null ) {
$this->operator = in_array($this->operator, [ '!=', '<>' ]) ? Where::COMPARISON_IS . " " . Where::CONDITION_NOT : Where::COMPARISON_IS;
return Where::COMPARISON_NULL;
}
elseif ( is_object($value) && ( $value instanceof EntityField ) ) {
return $value->name();
elseif (is_object($value) && ( $value instanceof WhereRawParameter ) ) {
return (string) $value;
}
else {
return $this->queryBuilder->addParameter($value);