Interface luya\admin\base\GenericSearchInterface
Generic Search Interface.
A searchable Active Record must integrate this Interface in order to make usage of the Administration Search UI.
Public Methods
Method | Description | Defined By |
---|---|---|
genericSearch() | The Query which is going to be performend to the concret implementation. | luya\admin\base\GenericSearchInterface |
genericSearchFields() | The fields to lookup with the search query. | luya\admin\base\GenericSearchInterface |
genericSearchHiddenFields() | An array with fields which will be hidden in the search output, but are available for the State Provider functions. | luya\admin\base\GenericSearchInterface |
genericSearchStateProvider() | The state provider is used to click on the items. Retuns an array with a configuration for the angular state provider. Example | luya\admin\base\GenericSearchInterface |
Method Details
The Query which is going to be performend to the concret implementation.
public abstract yii\db\QueryInterface|yii\db\ActiveQueryInterface|array genericSearch ( $searchQuery ) | ||
$searchQuery | string |
An HTML encoded string to lookup the database table. |
public function genericSearch($searchQuery);
The fields to lookup with the search query.
public abstract array genericSearchFields ( ) | ||
return | array |
An array with all fields where should be looked up against the genericSearch query. |
---|
public function genericSearchFields();
An array with fields which will be hidden in the search output, but are available for the State Provider functions.
public abstract array genericSearchHiddenFields ( ) | ||
return | array |
An array with fields which should be hide from the results, where value is the field name:
|
---|
public function genericSearchHiddenFields();
The state provider is used to click on the items. Retuns an array with a configuration for the angular state provider. Example
return [
'state' => 'custom.cmsedit',
'params' => [
'navId' => 'id'
]
];
The example above would look like this in the angular context
$state.go('custom.cmsedit', { navId : 1 });
All variable for the params are based on the generichSearchFields()
, if a variable is defined in the
generichSearchFields() method it can be used with % prefix in params value.
If genericSearchStateProvider() returns false the ability to click on the detail icon is disabled.
public abstract array|boolean genericSearchStateProvider ( ) | ||
return | array|boolean |
Returns the state config or when not clickable returns false |
---|
public function genericSearchStateProvider();