You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PHPFUI/ORM/Condition.php
+19-11Lines changed: 19 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -21,11 +21,11 @@ class Condition implements \Countable, \Stringable
21
21
*
22
22
* Will try to parse FVO from string if $operator is null.
23
23
*
24
-
* @param ?string $field single name (no .) of a field existing the the table. Will try to parse FVO from string if $operator is null.
24
+
* @param string|\PHPFUI\ORM\Literal|null $field single name (no .) of a field existing the the table. Will try to parse FVO from string if $operator is null.
25
25
* @param mixed $value to test field against. Must be string for LIKE operators and an array for IN operators.
26
26
* @param \PHPFUI\ORM\Operator $operator comparision of your choice
27
27
*/
28
-
publicfunction__construct(?string$field = null, mixed$value = null, \PHPFUI\ORM\Operator$operator = new \PHPFUI\ORM\Operator\Equal())
28
+
publicfunction__construct(string|\PHPFUI\ORM\Literal|null$field = null, mixed$value = null, \PHPFUI\ORM\Operator$operator = new \PHPFUI\ORM\Operator\Equal())
29
29
{
30
30
if ($field)
31
31
{
@@ -43,7 +43,8 @@ public function __toString() : string
43
43
44
44
foreach ($this->conditionsas$parts)
45
45
{
46
-
if (! \is_object($parts[1]))
46
+
47
+
if (! \is_object($parts[1]) || $parts[1] instanceof \PHPFUI\ORM\Literal)
47
48
{
48
49
if ($parts[0])
49
50
{
@@ -55,7 +56,14 @@ public function __toString() : string
0 commit comments