Your IP : 216.73.216.79


Current Path : /var/www/html/dyna-hr/models/
Upload File :
Current File : /var/www/html/dyna-hr/models/LeaveSettings.php

<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "leave_settings".
 *
 * @property int $id
 * @property int $user_id
 * @property string $leave_type
 * @property string $year
 * @property int $days
 * @property int $created_by
 * @property string $created_dt
 */
class LeaveSettings extends \yii\db\ActiveRecord {

    /**
     * {@inheritdoc}
     */
    public static function tableName() {
        return 'leave_settings';
    }

    /**
     * {@inheritdoc}
     */
    public function rules() {
        return [
            [['user_id', 'days', 'created_by'], 'integer'],
            [['year', 'created_dt'], 'safe'],
            [['leave_type'], 'string', 'max' => 255],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'user_id' => 'Staff',
            'leave_type' => 'Leave Type',
            'year' => 'Year',
            'days' => 'Days',
            'created_by' => 'Created By',
            'created_dt' => 'Created Dt',
        ];
    }

    public function yearlist() {
        $year_list = [];
        for ($y = (date('Y') + 1); $y >= '2020'; $y--) {
            $year_list[$y] = $y;
        }
        return $year_list;
    }

}