blob: 9736faa7e3defdb629770c589bbc1bfe2839d25b [file] [log] [blame]
Andrey Andreevc5536aa2012-11-01 17:33:58 +02001<?php
Derek Allard2067d1a2008-11-13 22:59:24 +00002/**
3 * CodeIgniter
4 *
Phil Sturgeon07c1ac82012-03-09 17:03:37 +00005 * An open source application development framework for PHP 5.2.4 or newer
Derek Allard2067d1a2008-11-13 22:59:24 +00006 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05007 * NOTICE OF LICENSE
Andrey Andreev64e98aa2012-01-07 20:29:10 +02008 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05009 * Licensed under the Open Software License version 3.0
Andrey Andreev64e98aa2012-01-07 20:29:10 +020010 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -050011 * This source file is subject to the Open Software License (OSL 3.0) that is
12 * bundled with this package in the files license.txt / license.rst. It is
13 * also available through the world wide web at this URL:
14 * http://opensource.org/licenses/OSL-3.0
15 * If you did not receive a copy of the license and are unable to obtain it
16 * through the world wide web, please send an email to
17 * licensing@ellislab.com so we can send you a copy immediately.
18 *
Derek Allard2067d1a2008-11-13 22:59:24 +000019 * @package CodeIgniter
Derek Jonesf4a4bd82011-10-20 12:18:42 -050020 * @author EllisLab Dev Team
darwinel871754a2014-02-11 17:34:57 +010021 * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
Derek Jonesf4a4bd82011-10-20 12:18:42 -050022 * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
Derek Allard2067d1a2008-11-13 22:59:24 +000023 * @link http://codeigniter.com
24 * @since Version 1.0
25 * @filesource
26 */
Andrey Andreevc5536aa2012-11-01 17:33:58 +020027defined('BASEPATH') OR exit('No direct script access allowed');
Derek Allard2067d1a2008-11-13 22:59:24 +000028
Derek Allard2067d1a2008-11-13 22:59:24 +000029/**
Andrey Andreev3e9d2b82012-10-27 14:28:51 +030030 * Model Class
Derek Allard2067d1a2008-11-13 22:59:24 +000031 *
32 * @package CodeIgniter
33 * @subpackage Libraries
34 * @category Libraries
Derek Jonesf4a4bd82011-10-20 12:18:42 -050035 * @author EllisLab Dev Team
Derek Allard2067d1a2008-11-13 22:59:24 +000036 * @link http://codeigniter.com/user_guide/libraries/config.html
37 */
Derek Jones8eae4d72010-03-02 13:47:19 -060038class CI_Model {
Derek Allard2067d1a2008-11-13 22:59:24 +000039
Timothy Warrenad475052012-04-19 13:21:06 -040040 /**
Andrey Andreev3e9d2b82012-10-27 14:28:51 +030041 * Class constructor
Andrey Andreev92ebfb62012-05-17 12:49:24 +030042 *
43 * @return void
Timothy Warrenad475052012-04-19 13:21:06 -040044 */
Andrey Andreev64e98aa2012-01-07 20:29:10 +020045 public function __construct()
Derek Allard2067d1a2008-11-13 22:59:24 +000046 {
Andrey Andreev88d03c42012-01-07 21:59:00 +020047 log_message('debug', 'Model Class Initialized');
Derek Allard2067d1a2008-11-13 22:59:24 +000048 }
49
Andrey Andreev3e9d2b82012-10-27 14:28:51 +030050 // --------------------------------------------------------------------
51
Derek Allard2067d1a2008-11-13 22:59:24 +000052 /**
Andrey Andreev3e9d2b82012-10-27 14:28:51 +030053 * __get magic
Derek Allard2067d1a2008-11-13 22:59:24 +000054 *
Pascal Kriete287781e2010-11-10 15:43:49 -050055 * Allows models to access CI's loaded classes using the same
56 * syntax as controllers.
Derek Allard2067d1a2008-11-13 22:59:24 +000057 *
Andrey Andreev3e9d2b82012-10-27 14:28:51 +030058 * @param string $key
Barry Mienydd671972010-10-04 16:33:58 +020059 */
Andrey Andreev64e98aa2012-01-07 20:29:10 +020060 public function __get($key)
Derek Allard2067d1a2008-11-13 22:59:24 +000061 {
Andrey Andreev096ddde2014-05-18 17:21:50 +030062 // Debugging note:
63 // If you're here because you're getting an error message
64 // saying 'Undefined Property: system/core/Model.php', it's
65 // most likely a typo in your model code.
Andrey Andreev119d8a72014-01-08 15:27:53 +020066 return get_instance()->$key;
Derek Allard2067d1a2008-11-13 22:59:24 +000067 }
Andrey Andreev92ebfb62012-05-17 12:49:24 +030068
Derek Allard2067d1a2008-11-13 22:59:24 +000069}
Derek Allard2067d1a2008-11-13 22:59:24 +000070
71/* End of file Model.php */
Timothy Warren40403d22012-04-19 16:38:50 -040072/* Location: ./system/core/Model.php */