<?php

namespace app\models;

use Yii;
use app\behaviours\ActiveRecordLogableBehavior;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;

/**
 * This is the model class for table "{{%labdeptmaster}}".
 *
 * @property integer $beneficiarycategory_id
 * @property string $dept_code
 * @property string $beneficiarycategory_name
 * @property string $status
 * @property integer $create_time
 * @property integer $create_user
 * @property integer $update_time
 * @property integer $update_user
 */
class Beneficiarycategory extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'beneficiary_category_master';
    }

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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['beneficiarycategory_name'], 'required'],
            [['beneficiarycategory_name'], 'string'],
			[['beneficiarycategory_name'], 'unique', 'message' => '{attribute} Already Exists'],
            [['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 [            
            'beneficiarycategory_name' => Yii::t('app', 'Beneficiarycategory'),
            'status' => Yii::t('app', 'Status'),
            'create_time' => Yii::t('app', 'Created Time'),
            'create_user' => Yii::t('app', 'Created By'),
            'update_time' => Yii::t('app', 'Last Updated Time'),
            'update_user' => Yii::t('app', 'Last Updated By'),
        ];
    }
}
