<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "frapl01_2a".
 *
 * @property string $FRAPL01_UUID
 * @property string $FRAPL01_2A_UUID
 * @property string $FRAPL01_2A_SKEMA_JENIS Jenis Skema
 * @property string $FRAPL01_2A_SKEMA_NAMA Judul
 * @property string $FRAPL01_2A_SKEMA_NOMOR Nomor
 * @property string|null $FRAPL01_2A_SERTIFIKASI
 * @property string|null $FRAPL01_2A_PKT
 * @property string|null $FRAPL01_2A_RPL
 * @property string|null $FRAPL01_2A_LAINNYA
 * @property string $CREATED
 * @property string $USERNAME
 */
class Frapl012a extends \yii\db\ActiveRecord
{

    /**
     * ENUM field values
     */
    const FRAPL01_2A_SKEMA_JENIS_KKNI = 'KKNI';
    const FRAPL01_2A_SKEMA_JENIS_OKUPASI = 'Okupasi';
    const FRAPL01_2A_SKEMA_JENIS_KLASTER = 'Klaster';

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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['FRAPL01_2A_SERTIFIKASI', 'FRAPL01_2A_PKT', 'FRAPL01_2A_RPL', 'FRAPL01_2A_LAINNYA'], 'default', 'value' => null],
            [['FRAPL01_UUID', 'FRAPL01_2A_UUID', 'FRAPL01_2A_SKEMA_JENIS', 'FRAPL01_2A_SKEMA_NAMA', 'FRAPL01_2A_SKEMA_NOMOR', 'CREATED', 'USERNAME'], 'required'],
            [['FRAPL01_UUID', 'FRAPL01_2A_UUID', 'FRAPL01_2A_SKEMA_JENIS'], 'string'],
            [['CREATED'], 'safe'],
            [['FRAPL01_2A_SKEMA_NAMA', 'FRAPL01_2A_SKEMA_NOMOR', 'USERNAME'], 'string', 'max' => 50],
            [['FRAPL01_2A_SERTIFIKASI', 'FRAPL01_2A_PKT', 'FRAPL01_2A_RPL', 'FRAPL01_2A_LAINNYA'], 'string', 'max' => 1],
            ['FRAPL01_2A_SKEMA_JENIS', 'in', 'range' => array_keys(self::optsFRAPL012ASKEMAJENIS())],
            [['FRAPL01_2A_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'FRAPL01_UUID' => 'Frapl01 Uuid',
            'FRAPL01_2A_UUID' => 'Frapl01 2a Uuid',
            'FRAPL01_2A_SKEMA_JENIS' => 'Jenis Skema',
            'FRAPL01_2A_SKEMA_NAMA' => 'Judul',
            'FRAPL01_2A_SKEMA_NOMOR' => 'Nomor',
            'FRAPL01_2A_SERTIFIKASI' => 'Frapl01 2a Sertifikasi',
            'FRAPL01_2A_PKT' => 'Frapl01 2a Pkt',
            'FRAPL01_2A_RPL' => 'Frapl01 2a Rpl',
            'FRAPL01_2A_LAINNYA' => 'Frapl01 2a Lainnya',
            'CREATED' => 'Created',
            'USERNAME' => 'Username',
        ];
    }


    /**
     * column FRAPL01_2A_SKEMA_JENIS ENUM value labels
     * @return string[]
     */
    public static function optsFRAPL012ASKEMAJENIS()
    {
        return [
            self::FRAPL01_2A_SKEMA_JENIS_KKNI => 'KKNI',
            self::FRAPL01_2A_SKEMA_JENIS_OKUPASI => 'Okupasi',
            self::FRAPL01_2A_SKEMA_JENIS_KLASTER => 'Klaster',
        ];
    }

    /**
     * @return string
     */
    public function displayFRAPL012ASKEMAJENIS()
    {
        return self::optsFRAPL012ASKEMAJENIS()[$this->FRAPL01_2A_SKEMA_JENIS];
    }

    /**
     * @return bool
     */
    public function isFRAPL012ASKEMAJENISKkni()
    {
        return $this->FRAPL01_2A_SKEMA_JENIS === self::FRAPL01_2A_SKEMA_JENIS_KKNI;
    }

    public function setFRAPL012ASKEMAJENISToKkni()
    {
        $this->FRAPL01_2A_SKEMA_JENIS = self::FRAPL01_2A_SKEMA_JENIS_KKNI;
    }

    /**
     * @return bool
     */
    public function isFRAPL012ASKEMAJENISOkupasi()
    {
        return $this->FRAPL01_2A_SKEMA_JENIS === self::FRAPL01_2A_SKEMA_JENIS_OKUPASI;
    }

    public function setFRAPL012ASKEMAJENISToOkupasi()
    {
        $this->FRAPL01_2A_SKEMA_JENIS = self::FRAPL01_2A_SKEMA_JENIS_OKUPASI;
    }

    /**
     * @return bool
     */
    public function isFRAPL012ASKEMAJENISKlaster()
    {
        return $this->FRAPL01_2A_SKEMA_JENIS === self::FRAPL01_2A_SKEMA_JENIS_KLASTER;
    }

    public function setFRAPL012ASKEMAJENISToKlaster()
    {
        $this->FRAPL01_2A_SKEMA_JENIS = self::FRAPL01_2A_SKEMA_JENIS_KLASTER;
    }
}
