SearchModel
class SearchModel (View source)
The Search model.
Properties
private | $Automad | The Automad results. | |
private | $regexFlags | The search regex flags. | |
private | $searchValue | The search value. |
Methods
Initialize a new search model for a search value, optionally used as a regular expression.
Perform a search in all data arrays and return an array with FileResultsModel
.
Append an item to a given array only in case it is an results.
Check whether a property name represents a valid block property.
Merge an array of FieldResultsModel
into a single results.
Search an array of values recursively.
Perform a search in a block field recursively and return a
FieldResultsModel
results for a given search value.
Perform a search in a single data array and return an
array of FieldResultsModel
.
Perform a search in a single data field and return a
FieldResultsModel
results for a given search value.
Details
at line 77
__construct(Automad $Automad, string $searchValue, bool $isRegex, bool $isCaseSensitive)
Initialize a new search model for a search value, optionally used as a regular expression.
at line 97
array
searchPerFile()
Perform a search in all data arrays and return an array with FileResultsModel
.
at line 128
private array
appendFieldResults(array $resultsArray, FieldResultsModel|null $results)
Append an item to a given array only in case it is an results.
at line 142
private bool
isValidBlockProperty(string $property)
Check whether a property name represents a valid block property.
at line 167
private FieldResultsModel|null
mergeFieldResults(string $key, array $results)
Merge an array of FieldResultsModel
into a single results.
at line 196
private FieldResultsModel
searchArrayRecursively(string $key, array $array)
Search an array of values recursively.
at line 220
private FieldResultsModel|null
searchBlocksRecursively(string $key, array $blocks)
Perform a search in a block field recursively and return a
FieldResultsModel
results for a given search value.
at line 255
private array
searchData(array $data)
Perform a search in a single data array and return an
array of FieldResultsModel
.
at line 286
private FieldResultsModel
searchTextField(string $key, string $value)
Perform a search in a single data field and return a
FieldResultsModel
results for a given search value.