mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
37 lines
762 B
PHP
37 lines
762 B
PHP
<?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;
|
|
}
|
|
}
|