rename task to project_task and task_user to project_task_user; create project_task_category, fix bug in create project method
This commit is contained in:
57
common/models/ProjectTaskCategory.php
Normal file
57
common/models/ProjectTaskCategory.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "project_task_category".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property int $project_id
|
||||
*
|
||||
* @property Project $project
|
||||
*/
|
||||
class ProjectTaskCategory extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'project_task_category';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['project_id'], 'integer'],
|
||||
[['title'], 'string', 'max' => 255],
|
||||
[['project_id'], 'exist', 'skipOnError' => true, 'targetClass' => Project::className(), 'targetAttribute' => ['project_id' => 'id']],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'title' => 'Название',
|
||||
'project_id' => 'Проект',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getProject()
|
||||
{
|
||||
return $this->hasOne(Project::className(), ['id' => 'project_id']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user