guild/common/models/Mark.php

61 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2023-01-23 17:50:38 +03:00
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "mark".
*
* @property int $id
* @property string $title
2023-10-06 00:37:46 +03:00
* @property string $slug
* @property string $color
* @property int $status
2023-01-23 17:50:38 +03:00
*
* @property ProjectMark[] $projectMarks
*/
class Mark extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'mark';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
2023-10-06 00:37:46 +03:00
[['title', 'slug', 'color'], 'string', 'max' => 255],
[['status'], 'integer'],
2023-01-23 17:50:38 +03:00
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'title' => 'Название',
2023-10-06 00:37:46 +03:00
'slug' => 'Ключ',
'color' => 'Цвет',
'status' => 'Статус',
2023-01-23 17:50:38 +03:00
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getProjectMarks()
{
return $this->hasMany(ProjectMark::className(), ['mark_id' => 'id']);
}
}