-
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.
- Loading branch information
Showing
21 changed files
with
1,141 additions
and
444 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
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
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 Pattern 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace FattureInCloud\ApiFilter\Filter; | ||
|
||
abstract class PatternOperator | ||
{ | ||
const LIKE = "like"; | ||
const CONTAINS = "contains"; | ||
const STARTS_WITH = "starts with"; | ||
const ENDS_WITH = "ends with"; | ||
} |
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.