add project statistic to api

This commit is contained in:
iIronside
2023-11-21 11:23:38 +03:00
parent 91607cc99b
commit 75329a8835
24 changed files with 929 additions and 25 deletions

View File

@@ -0,0 +1,53 @@
<?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']);
}
}