<?php

/*
 * *************************************************
 * Copyright (C) 2021 Earworks.                    *
 * Codeigniter Project Template Modification       *
 * Please contact our email for more information : *
 * contact@earworks.co.id                          *
 * *************************************************
 */

defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Description of User_data_model
 *
 * @author Andhy Taslin <andhy@earworks.co.id>
 * @since 1.0
 */
class User_data_model extends MY_Model {

    const STATUS_ACTIVE = 1;
    const STATUS_MAIL_SENT = 2;
    const STATUS_MAIL_FAILURE = 3;

    public $table = 'user_data';
    public $timestamp = true;

    public static function status_label($selected = null) {
        $lib = [
            self::STATUS_ACTIVE => lang('ACTIVE'),
            self::STATUS_MAIL_SENT => lang('MAIL_SENT'),
            self::STATUS_MAIL_FAILURE => lang('MAIL_FAILUER'),
        ];
        return array_key_exists($selected, $lib) ? $lib[$selected] : $lib;
    }

}
