@@ -77,7 +77,7 @@ |
||
| 77 | 77 | return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]); |
| 78 | 78 | }, |
| 79 | 79 | ]) ?> |
| 80 | - <?php endif;?> |
|
| 80 | + <?php endif; ?> |
|
| 81 | 81 | |
| 82 | 82 | </div> |
| 83 | 83 | </div> |
@@ -69,7 +69,8 @@ discard block |
||
| 69 | 69 | ['class' => 'yii\grid\ActionColumn'], |
| 70 | 70 | ], |
| 71 | 71 | ]); ?> |
| 72 | - <?php else: ?> |
|
| 72 | + <?php else { |
|
| 73 | + : ?> |
|
| 73 | 74 | <?= "<?= " ?>ListView::widget([ |
| 74 | 75 | 'dataProvider' => $dataProvider, |
| 75 | 76 | 'itemOptions' => ['class' => 'item'], |
@@ -77,7 +78,9 @@ discard block |
||
| 77 | 78 | return Html::a(Html::encode($model-><?= $nameAttribute ?>), ['view', <?= $urlParams ?>]); |
| 78 | 79 | }, |
| 79 | 80 | ]) ?> |
| 80 | - <?php endif;?> |
|
| 81 | + <?php endif; |
|
| 82 | +} |
|
| 83 | +?> |
|
| 81 | 84 | |
| 82 | 85 | </div> |
| 83 | 86 | </div> |
@@ -33,9 +33,12 @@ discard block |
||
| 33 | 33 | use <?= ltrim($generator->modelClass, '\\') ?>; |
| 34 | 34 | <?php if (!empty($generator->searchModelClass)): ?> |
| 35 | 35 | use <?= ltrim($generator->searchModelClass, '\\') . (isset($searchModelAlias) ? " as $searchModelAlias" : "") ?>; |
| 36 | -<?php else : ?> |
|
| 36 | +<?php else { |
|
| 37 | + : ?> |
|
| 37 | 38 | use yii\data\ActiveDataProvider; |
| 38 | -<?php endif; ?> |
|
| 39 | +<?php endif; |
|
| 40 | +} |
|
| 41 | +?> |
|
| 39 | 42 | use <?= ltrim($generator->baseControllerClass, '\\') ?>; |
| 40 | 43 | use yii\web\NotFoundHttpException; |
| 41 | 44 | use yii\web\ForbiddenHttpException; |
@@ -97,7 +100,8 @@ discard block |
||
| 97 | 100 | 'searchModel' => $searchModel, |
| 98 | 101 | 'dataProvider' => $dataProvider, |
| 99 | 102 | ]); |
| 100 | -<?php else : ?> |
|
| 103 | +<?php else { |
|
| 104 | + : ?> |
|
| 101 | 105 | $dataProvider = new ActiveDataProvider([ |
| 102 | 106 | 'query' => <?= $modelClass ?>::find(), |
| 103 | 107 | ]); |
@@ -105,7 +109,9 @@ discard block |
||
| 105 | 109 | return $this->render('index', [ |
| 106 | 110 | 'dataProvider' => $dataProvider, |
| 107 | 111 | ]); |
| 108 | -<?php endif; ?> |
|
| 112 | +<?php endif; |
|
| 113 | +} |
|
| 114 | +?> |
|
| 109 | 115 | } |
| 110 | 116 | |
| 111 | 117 | /** |
@@ -95,15 +95,15 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | /** {@inheritdoc} */ |
| 98 | - public function setSettings(){ |
|
| 98 | + public function setSettings() { |
|
| 99 | 99 | // get existing settings |
| 100 | 100 | |
| 101 | 101 | /** @var Setting $settingClass */ |
| 102 | 102 | $settingClass = $this->itemClass; |
| 103 | 103 | $query = $settingClass::find(); |
| 104 | 104 | $settings = $query->all(); |
| 105 | - if(!empty($settings)){ |
|
| 106 | - foreach ($settings as $setting){ |
|
| 105 | + if (!empty($settings)) { |
|
| 106 | + foreach ($settings as $setting) { |
|
| 107 | 107 | if (in_array($setting->key, array_keys($this->attributes))) { |
| 108 | 108 | $this->settings[$setting->key] = $setting; |
| 109 | 109 | $this->{$setting->key} = $setting->value; |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** {@inheritdoc} */ |
| 129 | - public function save(){ |
|
| 130 | - if(!empty($this->settings)){ |
|
| 131 | - foreach ($this->settings as $key=> $setting){ |
|
| 129 | + public function save() { |
|
| 130 | + if (!empty($this->settings)) { |
|
| 131 | + foreach ($this->settings as $key=> $setting) { |
|
| 132 | 132 | if (in_array($setting->key, array_keys($this->attributes))) { |
| 133 | 133 | $setting->save(); |
| 134 | 134 | $this->settings[$key] = $setting; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | * @param $key string |
| 46 | 46 | * @return static |
| 47 | 47 | */ |
| 48 | - public function findOneByKey($key){ |
|
| 48 | + public function findOneByKey($key) { |
|
| 49 | 49 | $model = static::find() |
| 50 | 50 | ->andWhere([$this->keyColumn => $key]) |
| 51 | 51 | ->one(); |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | // delete logically |
| 130 | 130 | if ($this->userUpdatedCol) { |
| 131 | - $this->{$this->userUpdatedCol} = $this->getIdentityId();; |
|
| 131 | + $this->{$this->userUpdatedCol} = $this->getIdentityId(); ; |
|
| 132 | 132 | } |
| 133 | 133 | if ($this->userClosedCol) { |
| 134 | - $this->{$this->userClosedCol} = $this->getIdentityId();; |
|
| 134 | + $this->{$this->userClosedCol} = $this->getIdentityId(); ; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if ($this->timeUpdatedCol) { |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | * @param string $tableName |
| 333 | 333 | * @return bool |
| 334 | 334 | */ |
| 335 | - private static function hasClosing($tableName){ |
|
| 335 | + private static function hasClosing($tableName) { |
|
| 336 | 336 | $closing = Closing::findOne($tableName); |
| 337 | 337 | return !($closing == null); |
| 338 | 338 | } |