mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Renaming of classes, making true recursive structure
This commit is contained in:
36
app/Support/Search/QueryParser/FieldNode.php
Normal file
36
app/Support/Search/QueryParser/FieldNode.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Search\QueryParser;
|
||||
|
||||
/**
|
||||
* Represents a field operator with value (e.g. amount:100)
|
||||
*/
|
||||
class FieldNode extends Node
|
||||
{
|
||||
private string $operator;
|
||||
private string $value;
|
||||
|
||||
public function __construct(string $operator, string $value, bool $prohibited = false)
|
||||
{
|
||||
$this->operator = $operator;
|
||||
$this->value = $value;
|
||||
$this->prohibited = $prohibited;
|
||||
}
|
||||
|
||||
public function getOperator(): string
|
||||
{
|
||||
return $this->operator;
|
||||
}
|
||||
|
||||
public function getValue(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return ($this->prohibited ? '-' : '') . $this->operator . ':' . $this->value;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user