<?php

namespace backend\models;

use Yii;
use common\models\Transfer;
use common\components\RoleDefinition;
use common\models\Account;
/**
 * TransferSearch represents the model behind the search form about `common\models\Transfer`.
 */
class TransferListSearch extends \common\models\TransferListSearch
{
	
	public function init(){
		parent::init();
		$this->mode = 'admin';
	}
	
	
	protected function addAccountConstraint($query){
// 	if ( !RoleDefinition::isAdmin() ){
//     		$query->innerJoin("user_account_assignment",'transfer.id_account = user_account_assignment.id_account' );
//     		$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
//     		$query->andWhere(['account.type' => Account::TYPE_ALL ]);
    		
//     		if ( RoleDefinition::isReception()){
//     			$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
//     		}
    		
//     	}
	} 
    
}
