- Some work done on correcting LDAP package compatibility

This commit is contained in:
mcndave committed 2021-03-09 15:25:46 +00:00
1 parent 71de0a8ac1
commit e3d0e45a4e
13 files changed
+110 -22

No files matched your search

+6 -1
View File
@@ -29,6 +29,9 @@ class Having extends Fragment {
public function add($field, $value, string $operator, string $condition, bool $not = false) : self
{
$this->validateFieldType($field);
# $this->validateValueType($value);
$this->conditionList[] = [
$field,
$value,
@@ -102,7 +105,8 @@ class Having extends Fragment {
return (in_array($this->operator, [ '!=', '<>' ]) ? Where::CONDITION_NOT . " " : "") . Where::COMPARISON_IN;
}
return $this->operator;
# whitelisting operators
return in_array(strtoupper($this->operator), [ '=', '!=', '<>', 'LIKE' ]) ? $this->operator : "=";
}
protected function value()
@@ -124,6 +128,7 @@ class Having 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 ) ) {