blob: 240db4397d68b2666830cbb67eb0e68c38cfc35b [file] [log] [blame]
adminb0dd10f2006-08-25 17:25:49 +00001<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2/**
3 * Code Igniter
4 *
5 * An open source application development framework for PHP 4.3.2 or newer
6 *
7 * @package CodeIgniter
8 * @author Rick Ellis
9 * @copyright Copyright (c) 2006, pMachine, Inc.
admine334c472006-10-21 19:44:22 +000010 * @license http://www.codeignitor.com/user_guide/license.html
adminb0dd10f2006-08-25 17:25:49 +000011 * @link http://www.codeigniter.com
12 * @since Version 1.0
13 * @filesource
14 */
admine334c472006-10-21 19:44:22 +000015
adminb0dd10f2006-08-25 17:25:49 +000016// ------------------------------------------------------------------------
17
18/**
19 * Code Igniter Model Class
20 *
21 * @package CodeIgniter
22 * @subpackage Libraries
23 * @category Libraries
24 * @author Rick Ellis
25 * @link http://www.codeigniter.com/user_guide/libraries/config.html
26 */
27class Model {
28
29 /**
30 * Constructor
31 *
32 * @access public
33 */
34 function Model()
35 {
admin0aef2222006-10-12 18:00:22 +000036 $this->_assign_libraries();
adminb0dd10f2006-08-25 17:25:49 +000037 log_message('debug', "Model Class Initialized");
38 }
adminb0dd10f2006-08-25 17:25:49 +000039
40 /**
41 * Assign Libraries
42 *
43 * Creates local references to all currently instantiated objects
admine334c472006-10-21 19:44:22 +000044 * so that any syntax that can be legally used in a controller
adminb0dd10f2006-08-25 17:25:49 +000045 * can be used within models.
46 *
47 * @access private
48 */
admin0aef2222006-10-12 18:00:22 +000049 function _assign_libraries()
adminb0dd10f2006-08-25 17:25:49 +000050 {
admin0aef2222006-10-12 18:00:22 +000051 $CI =& get_instance();
52
53 foreach (array_keys(get_object_vars($CI)) as $key)
54 {
55 $this->$key =& $CI->$key;
56 }
adminb0dd10f2006-08-25 17:25:49 +000057 }
adminb0dd10f2006-08-25 17:25:49 +000058
59}
60// END Model Class
61?>