<?php

namespace app\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%labresultsmaster}}".
 *
 * @property integer $lab_result_id
 * @property string $lab_result_code
 * @property string $lab_result_name
 * @property string $status
 * @property integer $del_status
 * @property integer $create_time
 * @property integer $create_user
 * @property integer $update_time
 * @property integer $update_user
 */
class Labresultsmaster extends \yii\db\ActiveRecord
{
	/**
	 * @inheritdoc
	 */
    public static function tableName()
	{
		return '{{%labresultsmaster}}';
	}

	/**
	 * @inheritdoc
	 */
	public function behaviors()
	{
		return [
			[
				'class' => TimestampBehavior::className(),
				'createdAtAttribute' => 'create_time',
				'updatedAtAttribute' => 'update_time',
				'value' => date('U'),
			]
		];
	}

	/**
	 * @inheritdoc
	 */
	public function rules()
	{
		return [
			[['lab_result_code', 'lab_result_name'], 'required'],
			[['lab_result_code', 'lab_result_name'], 'string'],
			[['del_status', 'create_time', 'create_user', 'update_time', 'update_user'], 'integer'],
			[['status'], 'string', 'max' => 1],
			[['record_date'], 'default', 'value' => strtotime(date('Y/m/d'))],
		];
	}

	/**
	 * @inheritdoc
	 */
	public function attributeLabels()
	{
		return [
			'lab_result_id' => Yii::t('app', 'Lab Result ID'),
			'lab_result_code' => Yii::t('app', 'Test Result Code'),
			'lab_result_name' => Yii::t('app', 'Test Result Name'),
			'status' => Yii::t('app', 'Status'),
			'del_status' => Yii::t('app', 'Del Status'),
			'create_time' => Yii::t('app', 'Create Time'),
			'create_user' => Yii::t('app', 'Create User'),
			'update_time' => Yii::t('app', 'Update Time'),
			'update_user' => Yii::t('app', 'Update User'),
		];
	}
}
