<?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_profile_model
 *
 * @author Andhy Taslin <andhy@earworks.co.id>
 * @since 1.0
 */
class User_profile_model extends MY_Model {

    const STATUS_ACTIVE = 1;
    const STATUS_BANNED = 2;

    protected $table = "user_profile";
     protected $primaryKey = 'user_id';
    public $timestamps = true;

    public static function status_label($selected = null) {
        $lib = [
            self::STATUS_ACTIVE => lang('ACTIVE'),
            self::STATUS_BANNED => lang('BANNED'),
        ];
        return array_key_exists($selected, $lib) ? $lib[$selected] : $lib;
    }
    public function user(){
        return $this->belongsTo(User_model::class);
    }
}
