ctms/ctms-admin/models/AuthRule.php
2025-04-10 23:19:13 +08:00

68 lines
1.3 KiB
PHP
Executable File

<?php
/**
* @Author: fm453
* @Date: 2021-09-10 17:36:45
* @Last Modified by: fm453
* @Last Modified time: 2021-09-10 17:40:19
* @Email: fm453@lukegzs.com
*/
namespace backend\models;
use Yii;
/**
* This is the model class for table "auth_rule".
*
* @property string $name
* @property string $data
* @property integer $created_at
* @property integer $updated_at
*
* @property AuthItem[] $authItems
*/
class AuthRule extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_rule}}';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name'], 'required'],
[['data'], 'string'],
[['created_at', 'updated_at'], 'integer'],
[['name'], 'string', 'max' => 64],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'name' => 'Name',
'data' => 'Data',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getAuthItems()
{
return $this->hasMany(AuthItem::className(), ['rule_name' => 'name']);
}
}