<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "master_kompetensi".
 *
 * @property string $SKEMA_UUID
 * @property string $MASKOM_UUID
 * @property string $MASKOM_KODE
 * @property string $MASKOM_JUDUL
 * @property string $CREATED
 * @property string $USERNAME
 */
class MasterKompetensi extends \yii\db\ActiveRecord
{


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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['SKEMA_UUID', 'MASKOM_UUID', 'MASKOM_KODE', 'MASKOM_JUDUL', 'CREATED', 'USERNAME'], 'required'],
            [['SKEMA_UUID', 'MASKOM_UUID'], 'string'],
            [['CREATED'], 'safe'],
            [['MASKOM_KODE'], 'string', 'max' => 15],
            [['MASKOM_JUDUL'], 'string', 'max' => 255],
            [['USERNAME'], 'string', 'max' => 50],
            [['MASKOM_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'SKEMA_UUID' => 'Skema Uuid',
            'MASKOM_UUID' => 'Maskom Uuid',
            'MASKOM_KODE' => 'Maskom Kode',
            'MASKOM_JUDUL' => 'Maskom Judul',
            'CREATED' => 'Created',
            'USERNAME' => 'Username',
        ];
    }

    public function getMasterSkema()
    {
        return $this->hasOne(MasterSkema::class, ['SKEMA_UUID' => 'SKEMA_UUID']);
    }
}
