%PDF- %PDF-
| Direktori : /home/vacivi36/intranet.vacivitta.com.br/protected/humhub/modules/user/models/ |
| Current File : /home/vacivi36/intranet.vacivitta.com.br/protected/humhub/modules/user/models/GroupAdmin.php |
<?php
namespace humhub\modules\user\models;
use humhub\components\ActiveRecord;
/**
* This is the model class for table "group_admin".
*
* @property integer $id
* @property integer $user_id
* @property integer $group_id
* @property string $created_at
* @property integer $created_by
* @property string $updated_at
* @property integer $updated_by
*/
class GroupAdmin extends ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'group_admin';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['user_id', 'group_id'], 'required'],
[['user_id', 'group_id'], 'integer'],
[['user_id', 'group_id'], 'unique', 'targetAttribute' => ['user_id', 'group_id'], 'message' => 'The combination of User ID and Group ID has already been taken.']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'user_id' => 'User ID',
'group_id' => 'Group ID',
'created_at' => 'Created At',
'created_by' => 'Created By',
'updated_at' => 'Updated At',
'updated_by' => 'Updated By',
];
}
public function getGroup()
{
return $this->hasOne(Group::class, ['id' => 'group_id']);
}
public function getUser()
{
return $this->hasOne(User::class, ['id' => 'user_id']);
}
}