1 | <?php |
||
34 | class OrganizationSetting extends BaseBlameableModel |
||
35 | { |
||
36 | /** |
||
37 | * @var string Host class. |
||
38 | * You must assign with your own [[Organization]] class. |
||
39 | */ |
||
40 | public $hostClass = Organization::class; |
||
41 | |||
42 | public $idAttribute = 'item'; |
||
43 | public $idPreassigned = true; |
||
44 | public $createdByAttribute = 'organization_guid'; |
||
45 | public $updatedByAttribute = false; |
||
46 | public $enableIP = false; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | public $operatorAttribute = 'operator_guid'; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | public $contentAttribute = 'value'; |
||
57 | |||
58 | /** |
||
59 | * Get operator query. |
||
60 | * If you want to get operator, please access [[$operator]] magic-property. |
||
61 | * @return BaseUserQuery |
||
62 | */ |
||
63 | public function getOperator() |
||
64 | { |
||
65 | if (empty($this->operatorAttribute) || !is_string($this->operatorAttribute)) { |
||
66 | return null; |
||
67 | } |
||
68 | $userClass = Yii::$app->user->identityClass; |
||
69 | $noInit = $userClass::buildNoInitModel(); |
||
70 | /* @var $noInit User */ |
||
71 | return $this->hasOne($userClass, [$noInit->guidAttribute => $this->operatorAttribute]); |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | 31 | public static function tableName() |
|
81 | |||
82 | /** |
||
83 | * @param Event $event |
||
84 | * @return null|string |
||
85 | */ |
||
86 | 31 | public function onAssignOperator($event) |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 31 | public function behaviors() |
|
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | 31 | public function rules() |
|
122 | |||
123 | /** |
||
124 | * @inheritdoc |
||
125 | */ |
||
126 | 31 | public function getContentRules() |
|
132 | |||
133 | /** |
||
134 | * @inheritdoc |
||
135 | */ |
||
136 | public function attributeLabels() |
||
148 | } |
||
149 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.