Skip to content

Commit

Permalink
added possibility to do 'not in()' queries in loadAll function
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-graute committed Jan 21, 2021
1 parent f3bbe38 commit 4cad2a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Pressmind/ORM/Object/AbstractObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function loadAll($where = null, $order = null, $limit = null)
} else {
$operator = '=';
}
if(strtolower($operator) == 'in') {
if(strtolower($operator) == 'in' || strtolower($operator) == 'not in') {
$value_array = explode(',', $value);
$variable_replacement = ' (' . implode(',', array_fill(0,count($value_array),'?')) . ')';
foreach ($value_array as $item) {
Expand All @@ -163,7 +163,7 @@ public function loadAll($where = null, $order = null, $limit = null)
} else if($value === 'IS NOT NULL') {
$operator = 'IS NOT NULL';
$variable_replacement = '';
} else if(strtolower($operator) != 'in') {
} else if(strtolower($operator) != 'in' && strtolower($operator) != 'not in') {
$values[] = $value;
}
$keys[] = $key;
Expand Down

0 comments on commit 4cad2a5

Please sign in to comment.