@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function search($query) |
67 | 67 | { |
68 | - foreach($this->models as $model) { |
|
68 | + foreach ($this->models as $model) { |
|
69 | 69 | /* @var BaseActiveRecord|SearchInterface $searchModel */ |
70 | 70 | $searchModel = Yii::createObject($model['class']); |
71 | 71 | |
72 | - if(!$this->isSearchModel($searchModel)) { |
|
72 | + if (!$this->isSearchModel($searchModel)) { |
|
73 | 73 | throw new InvalidConfigException( |
74 | 74 | $model['class'] . 'should be instance of `\vintage\search\interfaces\SearchInterface` and `\yii\db\ActiveRecordInterface`' |
75 | 75 | ); |
76 | 76 | } |
77 | 77 | |
78 | 78 | $activeQuery = $searchModel::find(); |
79 | - foreach($searchModel->getSearchFields() as $field) { |
|
80 | - if(!$searchModel->hasAttribute($field)) { |
|
79 | + foreach ($searchModel->getSearchFields() as $field) { |
|
80 | + if (!$searchModel->hasAttribute($field)) { |
|
81 | 81 | throw new \Exception(sprintf("Field `%s` not found in `%s` model", $field, $model['class'])); |
82 | 82 | } |
83 | 83 | |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function getModelLabel($modelName) |
100 | 100 | { |
101 | - foreach($this->models as $model) { |
|
102 | - if($model['class'] == $modelName) { |
|
101 | + foreach ($this->models as $model) { |
|
102 | + if ($model['class'] == $modelName) { |
|
103 | 103 | return $model['label']; |
104 | 104 | } |
105 | 105 | } |