25 lines
589 B
PHP
25 lines
589 B
PHP
<?php
|
|
|
|
namespace Ulmus\SearchRequest\Attribute;
|
|
|
|
use Ulmus\SearchRequest\SearchMethodEnum;
|
|
|
|
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
|
class SearchParameter {
|
|
|
|
public PropertyValueSource|array $source = PropertyValueSource::QueryParams;
|
|
|
|
public null|string|\Stringable|array $field = null;
|
|
|
|
public string $description = "";
|
|
|
|
public function getSources() : array
|
|
{
|
|
return is_array($this->source) ? $this->source : [ $this->source ];
|
|
}
|
|
|
|
public function getParameters() : array
|
|
{
|
|
return array_filter((array) ( $this->parameter ?? [] ));
|
|
}
|
|
} |