×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Nov 20, 2017 5:52 AM
Modified: Nov 21, 2017 7:55 AM
Views: 2
Tags: bonfire model
Skeleton file for CI Bonfire model
  1. defined('BASEPATH') || exit('No direct script access allowed');
  2.  
  3. class X_model extends BF_Model
  4. { //https://www.cibonfire.com/docs/developer/bonfire_models#skeleton
  5.     protected $table_name   = '';
  6.     protected $key          = 'id';
  7.     protected $soft_deletes = FALSE;
  8.     protected $date_format  = 'int';
  9.     protected $log_user     = FALSE;
  10.  
  11.     protected $set_created  = TRUE;
  12.     protected $created_field    = 'created_on';
  13.     protected $created_by_field = 'created_by';
  14.  
  15.     protected $set_modified     = FALSE;
  16.     protected $modified_field   = 'modified_on';
  17.     protected $modified_by_field = 'modified_by';
  18.  
  19.     protected $deleted_field    = 'deleted';
  20.     protected $deleted_by_field = 'deleted_by';
  21.  
  22.     // Observers
  23.     protected $before_insert    = array();
  24.     protected $after_insert     = array();
  25.     protected $before_update    = array();
  26.     protected $after_update     = array();
  27.     protected $before_find      = array();
  28.     protected $after_find       = array();
  29.     protected $before_delete    = array();
  30.     protected $after_delete     = array();
  31.  
  32.     protected $return_insert_id = true;
  33.     protected $return_type      = 'object';
  34.     protected $protected_attributes = array();
  35.     protected $field_info           = array();
  36.  
  37.     protected $validation_rules         = array();
  38.     protected $insert_validation_rules  = array();
  39.     protected $skip_validation          = false;
  40.     protected $empty_validation_rules   = array();
  41. }