forked from khalyomede/odata-query-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged validation and parsing functions
- Loading branch information
Showing
3 changed files
with
147 additions
and
168 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace GlobyApp\OdataQueryParser\Datatype; | ||
|
||
use GlobyApp\OdataQueryParser\Enum\FilterOperator; | ||
|
||
/** | ||
* @api Public get methods exposed to retrieve data from the result | ||
*/ | ||
class FilterClause | ||
{ | ||
private string $property; | ||
|
||
private FilterOperator $operator; | ||
|
||
/** | ||
* @var int|float|string|bool|null|array<int|float|string|bool|null> $value | ||
*/ | ||
private int|float|string|bool|null|array $value; | ||
|
||
/** | ||
* A filter clause with a field, an operator and the value to filter with | ||
* | ||
* @param string $property The property that should be filtered | ||
* @param FilterOperator $operator The filter operator used | ||
* @param int|float|string|bool|null|array<int|float|string|bool|null> $value The value to filter the property on with the operator | ||
*/ | ||
public function __construct(string $property, FilterOperator $operator, int|float|string|bool|null|array $value) | ||
{ | ||
$this->property = $property; | ||
$this->operator = $operator; | ||
$this->value = $value; | ||
} | ||
|
||
/** | ||
* @return string The property on which to filter | ||
*/ | ||
public function getProperty(): string | ||
{ | ||
return $this->property; | ||
} | ||
|
||
/** | ||
* @return FilterOperator The operator with which to filter | ||
*/ | ||
public function getOperator(): FilterOperator | ||
{ | ||
return $this->operator; | ||
} | ||
|
||
/** | ||
* @return int|float|string|bool|null|array<int|float|string|bool|null> The value to filter the property on with the operator | ||
*/ | ||
public function getValue(): int|float|string|bool|null|array | ||
{ | ||
return $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 was deleted.
Oops, something went wrong.