mirror of
				https://github.com/elyby/accounts.git
				synced 2025-05-31 14:11:46 +05:30 
			
		
		
		
	Контроллер для работы с RabbitMQ научился создавать типизированные аргументы для $body Добавлена таблица с историей ников Добавлена таблица Mojang ников Добавлена проверка активированности аккаунта в AccountsController
		
			
				
	
	
		
			46 lines
		
	
	
		
			927 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			927 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
namespace common\models;
 | 
						|
 | 
						|
use Yii;
 | 
						|
use yii\behaviors\TimestampBehavior;
 | 
						|
use yii\db\ActiveRecord;
 | 
						|
 | 
						|
/**
 | 
						|
 * Поля модели:
 | 
						|
 * @property integer $id
 | 
						|
 * @property string  $username
 | 
						|
 * @property integer $account_id
 | 
						|
 * @property integer $applied_in
 | 
						|
 *
 | 
						|
 * Отношения:
 | 
						|
 * @property Account $account
 | 
						|
 *
 | 
						|
 * Поведения:
 | 
						|
 * @mixin TimestampBehavior
 | 
						|
 */
 | 
						|
class UsernameHistory extends ActiveRecord {
 | 
						|
 | 
						|
    public static function tableName() {
 | 
						|
        return '{{%usernames_history}}';
 | 
						|
    }
 | 
						|
 | 
						|
    public function behaviors() {
 | 
						|
        return [
 | 
						|
            [
 | 
						|
                'class' => TimestampBehavior::class,
 | 
						|
                'createdAtAttribute' => 'applied_in',
 | 
						|
                'updatedAtAttribute' => false,
 | 
						|
            ],
 | 
						|
        ];
 | 
						|
    }
 | 
						|
 | 
						|
    public function rules() {
 | 
						|
        return [];
 | 
						|
    }
 | 
						|
 | 
						|
    public function getAccount() {
 | 
						|
        return $this->hasOne(Account::class, ['id' => 'account_id']);
 | 
						|
    }
 | 
						|
 | 
						|
}
 |