forked from mdmsoft/yii2-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssigment.php
44 lines (38 loc) · 873 Bytes
/
Assigment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace mdm\admin\models;
use yii\db\ActiveRecord;
use \Yii;
/**
* Description of Assigment
*
* @author MDMunir
*/
class Assigment extends ActiveRecord
{
//put your code here
private static $_useridField;
private static $_usernameField;
public static function tableName()
{
$class = Yii::$app->user->identityClass;
if(is_subclass_of($class, ActiveRecord::className())){
return $class::tableName();
}
return parent::tableName();
}
public function getUserid(){
}
public function getRoles(){
if(self::$_useridField === null){
$module = Yii::$app->controller->module;
if($module instanceof \mdm\admin\Module){
self::$_useridField = $module->useridField;
self::$_usernameField = $module->usernameField;
}else{
self::$_useridField = self::$_usernameField = '';
}
}
if(self::$_useridField != ''){
}
}
}