<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "frapl01".
 *
 * @property string $ASESMEN_UUID
 * @property string $FRAPL01_UUID
 * @property string|null $FRAPL01_LSP_REKOMENDASI Rekomendasi
 * @property string|null $FRAPL01_LSP_CATATAN Catatan
 * @property string|null $FRAPL01_LSP_USERNAME Admin LSP
 * @property string|null $FRAPL01_LSP_TGL Tanggal
 * @property string|null $FRAPL01_LSP_TTD Tanda Tangan
 * @property string|null $FRAPL01_USER_USERNAME Pemohon / Kandidat
 * @property string|null $FRAPL01_USER_TGL Tanggal
 * @property string|null $FRAPL01_USER_TTD Tanda Tangan
 */
class Frapl01 extends \yii\db\ActiveRecord
{

    /**
     * ENUM field values
     */
    const FRAPL01_LSP_REKOMENDASI_DITERIMA = 'Diterima';
    const FRAPL01_LSP_REKOMENDASI_TIDAK_DITERIMA = 'Tidak Diterima';

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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['FRAPL01_LSP_REKOMENDASI', 'FRAPL01_LSP_CATATAN', 'FRAPL01_LSP_USERNAME', 'FRAPL01_LSP_TGL', 'FRAPL01_LSP_TTD', 'FRAPL01_USER_USERNAME', 'FRAPL01_USER_TGL', 'FRAPL01_USER_TTD'], 'default', 'value' => null],
            [['ASESMEN_UUID', 'FRAPL01_UUID'], 'required'],
            [['ASESMEN_UUID', 'FRAPL01_UUID', 'FRAPL01_LSP_REKOMENDASI'], 'string'],
            [['FRAPL01_LSP_TGL', 'FRAPL01_USER_TGL'], 'safe'],
            [['FRAPL01_LSP_CATATAN'], 'string', 'max' => 255],
            [['FRAPL01_LSP_USERNAME', 'FRAPL01_LSP_TTD', 'FRAPL01_USER_USERNAME', 'FRAPL01_USER_TTD'], 'string', 'max' => 50],
            ['FRAPL01_LSP_REKOMENDASI', 'in', 'range' => array_keys(self::optsFRAPL01LSPREKOMENDASI())],
            [['FRAPL01_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ASESMEN_UUID' => 'Asesmen Uuid',
            'FRAPL01_UUID' => 'Frapl01 Uuid',
            'FRAPL01_LSP_REKOMENDASI' => 'Rekomendasi',
            'FRAPL01_LSP_CATATAN' => 'Catatan',
            'FRAPL01_LSP_USERNAME' => 'Admin LSP',
            'FRAPL01_LSP_TGL' => 'Tanggal',
            'FRAPL01_LSP_TTD' => 'Tanda Tangan',
            'FRAPL01_USER_USERNAME' => 'Pemohon / Kandidat',
            'FRAPL01_USER_TGL' => 'Tanggal',
            'FRAPL01_USER_TTD' => 'Tanda Tangan',
        ];
    }


    /**
     * column FRAPL01_LSP_REKOMENDASI ENUM value labels
     * @return string[]
     */
    public static function optsFRAPL01LSPREKOMENDASI()
    {
        return [
            self::FRAPL01_LSP_REKOMENDASI_DITERIMA => 'Diterima',
            self::FRAPL01_LSP_REKOMENDASI_TIDAK_DITERIMA => 'Tidak Diterima',
        ];
    }

    /**
     * @return string
     */
    public function displayFRAPL01LSPREKOMENDASI()
    {
        return self::optsFRAPL01LSPREKOMENDASI()[$this->FRAPL01_LSP_REKOMENDASI];
    }

    /**
     * @return bool
     */
    public function isFRAPL01LSPREKOMENDASIDiterima()
    {
        return $this->FRAPL01_LSP_REKOMENDASI === self::FRAPL01_LSP_REKOMENDASI_DITERIMA;
    }

    public function setFRAPL01LSPREKOMENDASIToDiterima()
    {
        $this->FRAPL01_LSP_REKOMENDASI = self::FRAPL01_LSP_REKOMENDASI_DITERIMA;
    }

    /**
     * @return bool
     */
    public function isFRAPL01LSPREKOMENDASITidakDiterima()
    {
        return $this->FRAPL01_LSP_REKOMENDASI === self::FRAPL01_LSP_REKOMENDASI_TIDAK_DITERIMA;
    }

    public function setFRAPL01LSPREKOMENDASIToTidakDiterima()
    {
        $this->FRAPL01_LSP_REKOMENDASI = self::FRAPL01_LSP_REKOMENDASI_TIDAK_DITERIMA;
    }
}
