<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "frapl02".
 *
 * @property string $ASESMEN_UUID
 * @property string $FRAPL02_UUID
 * @property string|null $FRAPL02_LSP_REKOMENDASI Rekomendasi
 * @property string|null $FRAPL02_LSP_USERNAME Asesor
 * @property string $FRAPL02_NOREG No. Reg
 * @property string|null $FRAPL02_LSP_TGL Tanggal
 * @property string|null $FRAPL02_LSP_TTD Tanda Tangan
 * @property string|null $FRAPL02_USER_USERNAME Asesi
 * @property string|null $FRAPL02_USER_TGL Tanggal
 * @property string|null $FRAPL02_USER_TTD Tanda Tangan
 */
class Frapl02 extends \yii\db\ActiveRecord
{

    /**
     * ENUM field values
     */
    const FRAPL02_LSP_REKOMENDASI_DITERIMA = 'Diterima';
    const FRAPL02_LSP_REKOMENDASI_DITOLAK = 'Ditolak';

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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['FRAPL02_LSP_REKOMENDASI', 'FRAPL02_LSP_USERNAME', 'FRAPL02_LSP_TGL', 'FRAPL02_LSP_TTD', 'FRAPL02_USER_USERNAME', 'FRAPL02_USER_TGL', 'FRAPL02_USER_TTD'], 'default', 'value' => null],
            [['ASESMEN_UUID', 'FRAPL02_UUID', 'FRAPL02_NOREG'], 'required'],
            [['ASESMEN_UUID', 'FRAPL02_UUID', 'FRAPL02_LSP_REKOMENDASI'], 'string'],
            [['FRAPL02_LSP_TGL', 'FRAPL02_USER_TGL'], 'safe'],
            [['FRAPL02_LSP_USERNAME', 'FRAPL02_NOREG', 'FRAPL02_LSP_TTD', 'FRAPL02_USER_USERNAME', 'FRAPL02_USER_TTD'], 'string', 'max' => 50],
            ['FRAPL02_LSP_REKOMENDASI', 'in', 'range' => array_keys(self::optsFRAPL02LSPREKOMENDASI())],
            [['FRAPL02_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ASESMEN_UUID' => 'Asesmen Uuid',
            'FRAPL02_UUID' => 'Frapl02 Uuid',
            'FRAPL02_LSP_REKOMENDASI' => 'Rekomendasi',
            'FRAPL02_LSP_USERNAME' => 'Asesor',
            'FRAPL02_NOREG' => 'No. Reg',
            'FRAPL02_LSP_TGL' => 'Tanggal',
            'FRAPL02_LSP_TTD' => 'Tanda Tangan',
            'FRAPL02_USER_USERNAME' => 'Asesi',
            'FRAPL02_USER_TGL' => 'Tanggal',
            'FRAPL02_USER_TTD' => 'Tanda Tangan',
        ];
    }


    /**
     * column FRAPL02_LSP_REKOMENDASI ENUM value labels
     * @return string[]
     */
    public static function optsFRAPL02LSPREKOMENDASI()
    {
        return [
            self::FRAPL02_LSP_REKOMENDASI_DITERIMA => 'Diterima',
            self::FRAPL02_LSP_REKOMENDASI_DITOLAK => 'Ditolak',
        ];
    }

    /**
     * @return string
     */
    public function displayFRAPL02LSPREKOMENDASI()
    {
        return self::optsFRAPL02LSPREKOMENDASI()[$this->FRAPL02_LSP_REKOMENDASI];
    }

    /**
     * @return bool
     */
    public function isFRAPL02LSPREKOMENDASIDiterima()
    {
        return $this->FRAPL02_LSP_REKOMENDASI === self::FRAPL02_LSP_REKOMENDASI_DITERIMA;
    }

    public function setFRAPL02LSPREKOMENDASIToDiterima()
    {
        $this->FRAPL02_LSP_REKOMENDASI = self::FRAPL02_LSP_REKOMENDASI_DITERIMA;
    }

    /**
     * @return bool
     */
    public function isFRAPL02LSPREKOMENDASIDitolak()
    {
        return $this->FRAPL02_LSP_REKOMENDASI === self::FRAPL02_LSP_REKOMENDASI_DITOLAK;
    }

    public function setFRAPL02LSPREKOMENDASIToDitolak()
    {
        $this->FRAPL02_LSP_REKOMENDASI = self::FRAPL02_LSP_REKOMENDASI_DITOLAK;
    }
}
