Skip to content

Commit

Permalink
rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
yiifans committed Feb 22, 2015
1 parent f50ef22 commit e112416
Show file tree
Hide file tree
Showing 83 changed files with 3,963 additions and 149 deletions.
57 changes: 57 additions & 0 deletions components/rbac/Assignment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace app\components\rbac;

use Yii;

/**
* This is the model class for table "{{%auth_assignment}}".
*
* @property string $item_name
* @property string $user_id
* @property integer $created_at
*
* @property AuthItem $itemName
*/
class Assignment extends \app\core\base\BaseActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return '{{%auth_assignment}}';
}

/**
* @inheritdoc
*/
public function rules()
{
return [
[['item_name', 'user_id'], 'required'],
[['created_at'], 'integer'],
[['item_name', 'user_id'], 'string', 'max' => 64]
];
}

/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'item_name' => 'Item Name',
'user_id' => 'User ID',
'created_at' => 'Created At',
];
}

/**
* @return \yii\db\ActiveQuery
*/
public function getItemName()
{
return $this->hasOne(AuthItem::className(), ['name' => 'item_name']);
}
}
Loading

0 comments on commit e112416

Please sign in to comment.