guild/common/models/ProjectRole.php
2023-11-21 11:23:38 +03:00

54 lines
906 B
PHP

<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "project_role".
*
* @property int $id
* @property string $title
*
* @property ProjectUser[] $projectUsers
*/
class ProjectRole extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'project_role';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['title'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'title' => 'Название роли',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProjectUsers()
{
return $this->hasMany(ProjectUser::className(), ['project_role_id' => 'id']);
}
}