31 lines
741 B
PHP
31 lines
741 B
PHP
<?php
|
|
|
|
namespace Ulmus\Annotation\Property;
|
|
|
|
use Ulmus\Query;
|
|
|
|
class Where implements \Notes\Annotation {
|
|
|
|
public /* stringable */ $field;
|
|
|
|
public $value;
|
|
|
|
public string $operator;
|
|
|
|
public string $condition;
|
|
|
|
public function __construct(/* ? Stringable */ $field = null, $value = null, ? string $operator = null, ? string $condition = null)
|
|
{
|
|
if ( $field !== null ) {
|
|
$this->field = $field;
|
|
}
|
|
|
|
if ( $value !== null ) {
|
|
$this->value = $value;
|
|
}
|
|
|
|
$this->operator = $operator !== null ? $operator : Query\Where::OPERATOR_EQUAL;
|
|
$this->condition = $condition !== null ? $condition : Query\Where::CONDITION_AND;
|
|
}
|
|
}
|