-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added null and not null conditions
- Loading branch information
Showing
24 changed files
with
1,336 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ phpunit.xml | |
.idea | ||
.vscode | ||
.DS_Store | ||
.antlr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
|
||
namespace FattureInCloud\ApiFilter\Filter; | ||
|
||
class Comparison implements Condition | ||
{ | ||
private $field; | ||
private $op; | ||
private $value; | ||
|
||
/** | ||
* @param $field | ||
* @param $op | ||
* @param $value | ||
*/ | ||
public function __construct($field, $op, $value) | ||
{ | ||
$this->field = $field; | ||
$this->op = $op; | ||
$this->value = $value; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getField(): string | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* @param string $field | ||
*/ | ||
public function setField(string $field): void | ||
{ | ||
$this->field = $field; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getOp(): string | ||
{ | ||
return $this->op; | ||
} | ||
|
||
/** | ||
* @param string $op | ||
*/ | ||
public function setOp(string $op): void | ||
{ | ||
$this->op = $op; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* @param mixed $value | ||
*/ | ||
public function setValue($value): void | ||
{ | ||
$this->value = $value; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return $this->field . " " . $this->op . " " . $this->value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace FattureInCloud\ApiFilter\Filter; | ||
|
||
class EmptyField implements Condition | ||
{ | ||
private $field; | ||
|
||
/** | ||
* @param $field | ||
*/ | ||
public function __construct($field) | ||
{ | ||
$this->field = $field; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getField(): string | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* @param string $field | ||
*/ | ||
public function setField(string $field): void | ||
{ | ||
$this->field = $field; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return $this->field . " = NULL"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace FattureInCloud\ApiFilter\Filter; | ||
|
||
class FilledField implements Condition | ||
{ | ||
private $field; | ||
|
||
/** | ||
* @param $field | ||
*/ | ||
public function __construct($field) | ||
{ | ||
$this->field = $field; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getField(): string | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* @param string $field | ||
*/ | ||
public function setField(string $field): void | ||
{ | ||
$this->field = $field; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return $this->field . " <> NULL"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.