Index

SearchProperty

MMO\core\attributes · 1 symbol · generated 5 Oct 2026

class

SearchProperty

SearchProperty.php:21

Declares a named, user-facing search field on a tArrayProperties-using class: a title/view for the UI, and a filter-expression template (buildFilters) that turns a user's search input into an actual FilterGroup. Every class using tArrayProperties automatically gets a 'label' SearchProperty.

#[Attribute(65)] class MMO\core\attributes\SearchProperty
Namespace
MMO\core\attributes
#[SearchProperty('label', 'Label', '(title $regex {$text}) || (label $regex {$text})')] class Person {use tArrayProperties;} Person::SearchProperty('label')->buildFilters(['text' => 'marc']); // a FilterGroup matching title/label

Index

config readonly
filters readonly
name readonly
order readonly
title readonly
view readonly
buildFilters($inputs)Render $filters against $inputs into an actual filter, ready to apply to a query.
__construct($name, $title, $filters, $view, $config, $order)

Properties6

config

readonly
readonly array $config
Type
array

filters

readonly
readonly string $filters
Type
string

name

readonly
readonly string $name
Type
string

order

readonly
readonly int $order
Type
int

title

readonly
readonly string $title
Type
string

view

readonly
readonly ?string $view
Type
null | string

Methods2

buildFilters($inputs)

SearchProperty.php:56

Render $filters against $inputs into an actual filter, ready to apply to a query.

function buildFilters(array $inputs): MMO\core\helpers\FilterGroupThe string MUST be a valid filter string ([`Filter::From`](https://mcp.mmoframework.fr/documentation/mmo.core/php/helpers/Filter.md#filter-from)) - `{$xxx}` is replaced by the user input `xxx`
$inputsarrayvalues for the {$xxx} placeholders in $filters
returnsFilterGroup
// filters template: '(date >= {$startDate}) || (date <= {$endDate})' $searchProperty->buildFilters(['startDate' => '2024-01-01', 'endDate' => '2024-12-31']);

__construct($name, $title, $filters, $view, $config, $order)

SearchProperty.php:37
function __construct( string $name, string $title, string $filters, ?string $view = null, array $config = [], int $order = 0 )
$namestring
$titlestring
$filtersstring
$view = nullnull | string
$config = []array
$order = 0int