Skip to content

Commit c4b1760

Browse files
authored
Neue YORM query Methoden whereListNotContains und havingNotListContains (#1576)
* new yorm query-method whereListNotContains() * add comments * change method name * add yorm method havingNotListContains()
1 parent 6d54240 commit c4b1760

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/manager/query.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,20 @@ public function whereListContains(string $column, $value): self
360360
return $this;
361361
}
362362

363+
/**
364+
* Where the comma separated list column contains NOT the given value or NONE of the given values.
365+
*
366+
* @param string $column Column with comma separated list
367+
* @param string|int|int[] $value Single value (string or int) or array of values (ints only)
368+
* @return $this
369+
*/
370+
public function whereNotListContains(string $column, $value): self
371+
{
372+
$this->where[] = 'NOT ' . $this->buildListContains(self::PARAM_WHERE, $column, $value);
373+
374+
return $this;
375+
}
376+
363377
/**
364378
* @param array<string, int|string> $params
365379
* @return $this
@@ -507,6 +521,20 @@ public function havingListContains(string $column, $value): self
507521
return $this;
508522
}
509523

524+
/**
525+
* Where the comma separated list column contains NOT the given value or NONE of the given values.
526+
*
527+
* @param string $column Column with comma separated list
528+
* @param string|int|int[] $value Single value (string or int) or array of values (ints only)
529+
* @return $this
530+
*/
531+
public function havingNotListContains(string $column, $value): self
532+
{
533+
$this->having[] = 'NOT ' . $this->buildListContains(self::PARAM_HAVING, $column, $value);
534+
535+
return $this;
536+
}
537+
510538
/**
511539
* @param array<string, int|string> $params
512540
* @return $this

0 commit comments

Comments
 (0)