Interface luya\admin\base\GenericSearchInterface

Implemented byluya\admin\models\ApiUser, luya\admin\models\Config, luya\admin\models\Group, luya\admin\models\Lang, luya\admin\models\Logger, luya\admin\models\NgrestLog, luya\admin\models\Property, luya\admin\models\ProxyBuild, luya\admin\models\ProxyMachine, luya\admin\models\QueueLog, luya\admin\models\QueueLogError, luya\admin\models\StorageEffect, luya\admin\models\StorageFilter, luya\admin\models\StorageImage, luya\admin\models\Tag, luya\admin\models\User, luya\admin\models\UserRequest, luya\admin\ngrest\base\NgRestModel, luya\cms\models\Block, luya\cms\models\BlockGroup, luya\cms\models\Layout, luya\cms\models\Log, luya\cms\models\NavContainer, luya\cms\models\NavItem, luya\cms\models\Redirect, luya\cms\models\Theme, luya\cms\models\Website
Available since version1.0.0

Generic Search Interface.

A searchable Active Record must integrate this Interface in order to make usage of the Administration Search UI.

Public Methods

Hide inherited 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

Hide inherited methods

genericSearch() public abstract method

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);

            
genericSearchFields() public abstract method

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();

            
genericSearchHiddenFields() public abstract method

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:

return [
    'hide', 'me', 'too',
];

                public function genericSearchHiddenFields();

            
genericSearchStateProvider() public abstract method

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();