diff --git a/messages/de/yii2mod.settings.php b/messages/de/yii2mod.settings.php index 1a078a4..be2c63a 100644 --- a/messages/de/yii2mod.settings.php +++ b/messages/de/yii2mod.settings.php @@ -24,8 +24,8 @@ 'Value' => 'Wert', 'Status' => 'Status', 'Description' => 'Beschreibung', - 'Created date' => 'Erstellungsdatum', - 'Updated date' => 'Änderungsdatum', + 'Created Date' => 'Erstellungsdatum', + 'Updated Date' => 'Änderungsdatum', 'Settings' => 'Einstellungen', 'Create Setting' => 'Einstellung hinzufügen', 'Select Type' => 'Typ auswählen', diff --git a/messages/en/yii2mod.settings.php b/messages/en/yii2mod.settings.php index a2dfcc5..af87076 100644 --- a/messages/en/yii2mod.settings.php +++ b/messages/en/yii2mod.settings.php @@ -24,8 +24,8 @@ 'Value' => 'Value', 'Status' => 'Status', 'Description' => 'Description', - 'Created date' => 'Created date', - 'Updated date' => 'Updated date', + 'Created Date' => 'Created Date', + 'Updated Date' => 'Updated Date', 'Settings' => 'Settings', 'Create Setting' => 'Create Setting', 'Select Type' => 'Select Type', diff --git a/messages/ru/yii2mod.settings.php b/messages/ru/yii2mod.settings.php index 4afe736..b80853d 100644 --- a/messages/ru/yii2mod.settings.php +++ b/messages/ru/yii2mod.settings.php @@ -24,8 +24,8 @@ 'Value' => 'Значение', 'Status' => 'Статус', 'Description' => 'Описание', - 'Created date' => 'Дата создания', - 'Updated date' => 'Дата обновления', + 'Created Date' => 'Дата Создания', + 'Updated Date' => 'Дата Обновления', 'Settings' => 'Настройки', 'Create Setting' => 'Создать Настройку', 'Select Type' => 'Выберите Тип', diff --git a/messages/uk/yii2mod.settings.php b/messages/uk/yii2mod.settings.php index 7b3bb3e..119cad5 100644 --- a/messages/uk/yii2mod.settings.php +++ b/messages/uk/yii2mod.settings.php @@ -24,8 +24,8 @@ 'Value' => 'Значення', 'Status' => 'Статус', 'Description' => 'Опис', - 'Created date' => 'Дата створення', - 'Updated date' => 'Дата поновлення', + 'Created Date' => 'Дата Створення', + 'Updated Date' => 'Дата Поновлення', 'Settings' => 'Налаштування', 'Create Setting' => 'Створити Налаштування', 'Select Type' => 'Виберіть Тип', diff --git a/migrations/m170413_125133_rename_date_columns.php b/migrations/m170413_125133_rename_date_columns.php new file mode 100644 index 0000000..ec350bd --- /dev/null +++ b/migrations/m170413_125133_rename_date_columns.php @@ -0,0 +1,29 @@ +renameColumn('{{%setting}}', 'createdAt', 'created_at'); + $this->renameColumn('{{%setting}}', 'updatedAt', 'updated_at'); + } + + public function down() + { + $this->renameColumn('{{%setting}}', 'created_at', 'createdAt'); + $this->renameColumn('{{%setting}}', 'updated_at', 'updatedAt'); + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/models/SettingModel.php b/models/SettingModel.php index ac37972..8054bd9 100644 --- a/models/SettingModel.php +++ b/models/SettingModel.php @@ -10,7 +10,7 @@ use yii2mod\settings\models\enumerables\SettingType; /** - * This is the model class for table "Settings". + * This is the model class for table "{{%setting}}". * * @property int $id * @property string $type @@ -19,8 +19,8 @@ * @property string $value * @property bool $status * @property string $description - * @property string $createdAt - * @property string $updatedAt + * @property string $created_at + * @property string $updated_at */ class SettingModel extends ActiveRecord { @@ -62,8 +62,8 @@ public function attributeLabels() 'value' => Yii::t('yii2mod.settings', 'Value'), 'status' => Yii::t('yii2mod.settings', 'Status'), 'description' => Yii::t('yii2mod.settings', 'Description'), - 'createdAt' => Yii::t('yii2mod.settings', 'Created date'), - 'updatedAt' => Yii::t('yii2mod.settings', 'Updated date'), + 'created_at' => Yii::t('yii2mod.settings', 'Created Date'), + 'updated_at' => Yii::t('yii2mod.settings', 'Updated Date'), ]; } @@ -73,11 +73,7 @@ public function attributeLabels() public function behaviors() { return [ - 'timestamp' => [ - 'class' => TimestampBehavior::class, - 'createdAtAttribute' => 'createdAt', - 'updatedAtAttribute' => 'updatedAt', - ], + TimestampBehavior::class, ]; } diff --git a/models/search/SettingSearch.php b/models/search/SettingSearch.php index 19b24c4..57c814b 100644 --- a/models/search/SettingSearch.php +++ b/models/search/SettingSearch.php @@ -30,11 +30,11 @@ public function rules() /** * Creates data provider instance with search query applied * - * @param $params + * @param array $params * * @return ActiveDataProvider */ - public function search($params) + public function search(array $params) { $query = self::find(); diff --git a/tests/TestCase.php b/tests/TestCase.php index c2d9275..1b3e0a3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -107,8 +107,8 @@ protected function setupTestDbData() 'value' => 'text not null', 'status' => 'smallint not null default 1', 'description' => 'string', - 'createdAt' => 'integer not null', - 'updatedAt' => 'integer not null', + 'created_at' => 'integer not null', + 'updated_at' => 'integer not null', ])->execute(); } }