Class yii\httpclient\debug\SearchModel

Inheritanceyii\httpclient\debug\SearchModel » yii\debug\models\search\Base
Available since extension's version2.0
Source Code https://github.com/yiisoft/yii2-httpclient/blob/master/src/debug/SearchModel.php

Log search model.

Public Properties

Hide inherited properties

Property Type Description Defined By
$method string Method of the input search value yii\httpclient\debug\SearchModel
$request integer Request attribute input search value yii\httpclient\debug\SearchModel
$type string Type of the input search value yii\httpclient\debug\SearchModel

Public Methods

Hide inherited methods

Method Description Defined By
attributeLabels() yii\httpclient\debug\SearchModel
rules() yii\httpclient\debug\SearchModel
search() Returns data provider with filled models. Filter applied if needed. yii\httpclient\debug\SearchModel

Property Details

Hide inherited properties

$method public property

Method of the input search value

public string $method null
$request public property

Request attribute input search value

public integer $request null
$type public property

Type of the input search value

public string $type null

Method Details

Hide inherited methods

attributeLabels() public method

public void attributeLabels ( )

                public function attributeLabels()
{
    return [
        'type' => 'Type',
        'method' => 'Method',
        'request' => 'Request',
    ];
}

            
rules() public method

public void rules ( )

                public function rules()
{
    return [
        [['type', 'method', 'request'], 'safe'],
    ];
}

            
search() public method

Returns data provider with filled models. Filter applied if needed.

public \yii\data\ArrayDataProvider search ( $params, $models )
$params array

An array of parameter values indexed by parameter names

$models array

Data to return provider for

                public function search($params, $models)
{
    $dataProvider = new ArrayDataProvider([
        'allModels' => $models,
        'pagination' => false,
        'sort' => [
            'attributes' => ['duration', 'seq', 'type', 'method', 'request'],
            'defaultOrder' => [
                'duration' => SORT_DESC,
            ],
        ],
    ]);
    if (!($this->load($params) && $this->validate())) {
        return $dataProvider;
    }
    $filter = new Filter();
    $this->addCondition($filter, 'type', true);
    $this->addCondition($filter, 'method', true);
    $this->addCondition($filter, 'request', true);
    $dataProvider->allModels = $filter->filter($models);
    return $dataProvider;
}