<?php

/*
 * *************************************************
 * Copyright (C) 2020 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');

/**
 * @baseClass@
 * Please don't use this class directly.
 * Extend this class to another model class and use it
 * @author andhy
 */
class @baseClass@ extends MY_Model {

    /**
     * Database group
     * @var string
     */
    public $database = '@database@';
    
    /**
     * Table Name
     * @var string
     */
    public $table = '@table@';
    
    /**
     * Primary Key
     * @var string
     */
    public $pri = '@pri@';
    
    /**
     * created_at field
     * if deleted, created_at and updated_at will be disabled
     * @var string 
     */
    public $created_at = 'createdAt';
    
    /**
     * updated_at field
     * if deleted, created_at and updated_at will be disabled
     * @var string 
     */
    public $updated_at = 'updatedAt';

@const@

@functionLib@

    /**
     * Rules Library for all field in this table.
     * Can be overrided on child class
     * @return array
     */
    public static function rules() {
        return [
@rules@
        ];
    }
    
    /**
     * Only search query for where clause
     * Can be overrided on child class
     * @param string $keyword
     */
    public function search_query($keyword = null) {
        if ($keyword) {
@search@
        }
    }

}