<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "frapl01_1a".
 *
 * @property string $FRAPL01_UUID
 * @property string $FRAPL01_1A_UUID
 * @property string $FRAPL01_1A_NAMA Nama Lengkap
 * @property int $FRAPL01_1A_NIK No. KTP/NIK/Paspor
 * @property string $FRAPL01_1A_TGL_LAHIR Tanggal Lahir
 * @property string $FRAPL01_1A_TPT_LAHIR Tempat Lahir
 * @property string $FRAPL01_1A_JK Jenis Kelamin
 * @property string $FRAPL01_1A_KEBANGSAAN Kebangsaan
 * @property string $FRAPL01_1A_ALAMAT Alamat Rumah
 * @property string $FRAPL01_1A_POS Kode Pos
 * @property string $FRAPL01_1A_TEL_RUMAH Telepon Rumah
 * @property string $FRAPL01_1A_TEL_KANTOR Telepon Kantor
 * @property string $FRAPL01_1A_HP Nomor HP
 * @property string $FRAPL01_1A_EMAIL Email
 * @property string $FRAPL01_1A_JENJANG Jenjang
 * @property string $FRAPL01_1A_JURUSAN Jurusan
 * @property string $FRAPL01_1A_KAMPUS Nama Kampus
 * @property string $FRAPL01_1A_THN_LULUS Tahun Lulus
 * @property int $CREATED
 * @property string $USERNAME
 */
class Frapl011a extends \yii\db\ActiveRecord
{

    /**
     * ENUM field values
     */
    const FRAPL01_1A_JK_LAKI_LAKI = 'Laki-Laki';
    const FRAPL01_1A_JK_WANITA = 'Wanita';

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

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['FRAPL01_UUID', 'FRAPL01_1A_UUID', 'FRAPL01_1A_NAMA', 'FRAPL01_1A_NIK', 'FRAPL01_1A_TGL_LAHIR', 'FRAPL01_1A_TPT_LAHIR', 'FRAPL01_1A_JK', 'FRAPL01_1A_KEBANGSAAN', 'FRAPL01_1A_ALAMAT', 'FRAPL01_1A_POS', 'FRAPL01_1A_TEL_RUMAH', 'FRAPL01_1A_TEL_KANTOR', 'FRAPL01_1A_HP', 'FRAPL01_1A_EMAIL', 'FRAPL01_1A_JENJANG', 'FRAPL01_1A_JURUSAN', 'FRAPL01_1A_KAMPUS', 'FRAPL01_1A_THN_LULUS', 'CREATED', 'USERNAME'], 'required'],
            [['FRAPL01_UUID', 'FRAPL01_1A_UUID', 'FRAPL01_1A_JK'], 'string'],
            [['FRAPL01_1A_NIK', 'CREATED'], 'integer'],
            [['FRAPL01_1A_TGL_LAHIR', 'FRAPL01_1A_THN_LULUS'], 'safe'],
            [['FRAPL01_1A_NAMA', 'FRAPL01_1A_KAMPUS'], 'string', 'max' => 100],
            [['FRAPL01_1A_TPT_LAHIR', 'FRAPL01_1A_KEBANGSAAN', 'FRAPL01_1A_EMAIL', 'FRAPL01_1A_JURUSAN', 'USERNAME'], 'string', 'max' => 50],
            [['FRAPL01_1A_ALAMAT'], 'string', 'max' => 255],
            [['FRAPL01_1A_POS'], 'string', 'max' => 5],
            [['FRAPL01_1A_TEL_RUMAH', 'FRAPL01_1A_TEL_KANTOR', 'FRAPL01_1A_HP'], 'string', 'max' => 25],
            [['FRAPL01_1A_JENJANG'], 'string', 'max' => 10],
            ['FRAPL01_1A_JK', 'in', 'range' => array_keys(self::optsFRAPL011AJK())],
            [['FRAPL01_1A_UUID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'FRAPL01_UUID' => 'Frapl01 Uuid',
            'FRAPL01_1A_UUID' => 'Frapl01 1a Uuid',
            'FRAPL01_1A_NAMA' => 'Nama Lengkap',
            'FRAPL01_1A_NIK' => 'No. KTP/NIK/Paspor',
            'FRAPL01_1A_TGL_LAHIR' => 'Tanggal Lahir',
            'FRAPL01_1A_TPT_LAHIR' => 'Tempat Lahir',
            'FRAPL01_1A_JK' => 'Jenis Kelamin',
            'FRAPL01_1A_KEBANGSAAN' => 'Kebangsaan',
            'FRAPL01_1A_ALAMAT' => 'Alamat Rumah',
            'FRAPL01_1A_POS' => 'Kode Pos',
            'FRAPL01_1A_TEL_RUMAH' => 'Telepon Rumah',
            'FRAPL01_1A_TEL_KANTOR' => 'Telepon Kantor',
            'FRAPL01_1A_HP' => 'Nomor HP',
            'FRAPL01_1A_EMAIL' => 'Email',
            'FRAPL01_1A_JENJANG' => 'Jenjang',
            'FRAPL01_1A_JURUSAN' => 'Jurusan',
            'FRAPL01_1A_KAMPUS' => 'Nama Kampus',
            'FRAPL01_1A_THN_LULUS' => 'Tahun Lulus',
            'CREATED' => 'Created',
            'USERNAME' => 'Username',
        ];
    }


    /**
     * column FRAPL01_1A_JK ENUM value labels
     * @return string[]
     */
    public static function optsFRAPL011AJK()
    {
        return [
            self::FRAPL01_1A_JK_LAKI_LAKI => 'Laki-Laki',
            self::FRAPL01_1A_JK_WANITA => 'Wanita',
        ];
    }

    /**
     * @return string
     */
    public function displayFRAPL011AJK()
    {
        return self::optsFRAPL011AJK()[$this->FRAPL01_1A_JK];
    }

    /**
     * @return bool
     */
    public function isFRAPL011AJKLakiLaki()
    {
        return $this->FRAPL01_1A_JK === self::FRAPL01_1A_JK_LAKI_LAKI;
    }

    public function setFRAPL011AJKToLakiLaki()
    {
        $this->FRAPL01_1A_JK = self::FRAPL01_1A_JK_LAKI_LAKI;
    }

    /**
     * @return bool
     */
    public function isFRAPL011AJKWanita()
    {
        return $this->FRAPL01_1A_JK === self::FRAPL01_1A_JK_WANITA;
    }

    public function setFRAPL011AJKToWanita()
    {
        $this->FRAPL01_1A_JK = self::FRAPL01_1A_JK_WANITA;
    }
}
