prolab-api/common/models/CytoPapStain.php

75 lines
1.7 KiB
PHP

<?php
namespace common\models;
use Yii;
use yii\behaviors\BlameableBehavior;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "cyto_pap_stain".
*
* @property int $id
* @property string $id_case
* @property int|null $stain_id
* @property string|null $stain_at
* @property int|null $created_by
* @property int|null $created_at
* @property int|null $updated_by
* @property int|null $updated_at
*/
class CytoPapStain extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'cyto_pap_stain';
}
public function behaviors()
{
return [
TimestampBehavior::class,
BlameableBehavior::class,
];
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['id_case', 'stain_id', 'stain_at'], 'required'],
[['stain_id', 'created_by', 'created_at', 'updated_by', 'updated_at'], 'integer'],
[['stain_at'], 'safe'],
[['id_case'], 'string', 'max' => 12],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'id_case' => 'ID Case',
'stain_id' => 'ผู้ย้อม',
'stain_at' => 'วันที่ย้อม',
'created_by' => 'Created By',
'created_at' => 'Created At',
'updated_by' => 'Updated By',
'updated_at' => 'Updated At',
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getStainBy()
{
return $this->hasOne(User::class, ['id' => 'stain_id']);
}
}