@@ -64,15 +64,15 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function search($query) |
66 | 66 | { |
67 | - foreach($this->models as $model) { |
|
67 | + foreach ($this->models as $model) { |
|
68 | 68 | /* @var BaseActiveRecord|SearchInterface $searchModel */ |
69 | 69 | $searchModel = Yii::createObject($model['class']); |
70 | 70 | |
71 | - if($this->isSearchModel($searchModel)) { |
|
71 | + if ($this->isSearchModel($searchModel)) { |
|
72 | 72 | $activeQuery = $searchModel::find(); |
73 | 73 | |
74 | - foreach($searchModel->getSearchFields() as $field) { |
|
75 | - if($searchModel->hasAttribute($field)) { |
|
74 | + foreach ($searchModel->getSearchFields() as $field) { |
|
75 | + if ($searchModel->hasAttribute($field)) { |
|
76 | 76 | $activeQuery->orWhere(['like', $field, $query]); |
77 | 77 | } else { |
78 | 78 | throw new \Exception(sprintf("Field `%s` not found in `%s` model", $field, $model['class'])); |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function getModelLabel($modelName) |
99 | 99 | { |
100 | - foreach($this->models as $model) { |
|
101 | - if($model['class'] == $modelName) { |
|
100 | + foreach ($this->models as $model) { |
|
101 | + if ($model['class'] == $modelName) { |
|
102 | 102 | return $model['label']; |
103 | 103 | } |
104 | 104 | } |