self::getTypeName(self::TYPE_TRUECALLER) ]; } 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 'tokens'; } /** * @inheritdoc */ public function rules() { return [ [['type', 'token'], 'required'], ['server_id', 'integer'], ['server_id', 'default', 'value' => 0], ['status', 'in', 'range' => array_keys(self::getTypes())], ['tm_ban', 'safe'] ]; } public function attributeLabels() { return [ 'id' => 'ID', 'type' => 'Тип', 'server_id' => 'Сервер', 'token' => 'Токен', 'status' => 'Статус', 'tm_ban' => 'Время блокировки' ]; } }