1
0
Fork 0
mirror of https://github.com/janickiy/yii2-nomer synced 2025-02-15 03:11:58 +00:00
yii2-nomer/models/EmailTemplates.php
2020-02-05 06:34:26 +03:00

53 lines
1.1 KiB
PHP

<?php
namespace app\models;
use Yii;
class EmailTemplates extends \yii\db\ActiveRecord
{
const STATUS_INACTIVE = 0;
const STATUS_ACTIVE = 1;
public static function getStatusName($status) {
switch ($status) {
case self::STATUS_INACTIVE: return 'Неактивный';
case self::STATUS_ACTIVE: return 'Активный';
default: return null;
}
}
/**
* @inheritdoc
*/
public static function tableName()
{
return 'email_templates';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['subject', 'message'], 'required'],
[['status'], 'integer'],
[['tm_create'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'subject' => 'Тема',
'message' => 'Сообщение',
'status' => 'Статус',
'tm_create' => 'Создан',
];
}
}