<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "master_skema".
 *
 * @property string $SKEMA_UUID
 * @property string $SKEMA_NOMOR
 * @property string $SKEMA_NAMA
 * @property string $SKEMA_JENIS
 * @property float $SKEMA_BIAYA
 * @property string $CREATED
 * @property string $USERNAME
 */
class MasterSkema extends \yii\db\ActiveRecord
{


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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['SKEMA_UUID', 'SKEMA_NOMOR', 'SKEMA_NAMA', 'SKEMA_JENIS', 'SKEMA_BIAYA', 'CREATED', 'USERNAME'], 'required'],
            [['SKEMA_UUID'], 'string'],
            [['SKEMA_BIAYA'], 'number'],
            [['CREATED'], 'safe'],
            [['SKEMA_NOMOR', 'SKEMA_JENIS', 'USERNAME'], 'string', 'max' => 50],
            [['SKEMA_NAMA'], 'string', 'max' => 255],
            [['SKEMA_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'SKEMA_UUID' => 'Skema Uuid',
            'SKEMA_NOMOR' => 'Skema Nomor',
            'SKEMA_NAMA' => 'Skema Nama',
            'SKEMA_JENIS' => 'Skema Jenis',
            'SKEMA_BIAYA' => 'Skema Biaya',
            'CREATED' => 'Created',
            'USERNAME' => 'Username',
        ];
    }

    public function getMasterKompetensi()
    {
        return $this->hasMany(MasterKompetensi::class, ['SKEMA_UUID' => 'SKEMA_UUID']);
    }

}
