From f05ee7168067980cc144e041a7affa36be889d84 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 23 Jan 2016 15:36:37 +0800 Subject: [PATCH] =?UTF-8?q?ORM=E7=B1=BB=E6=94=AF=E6=8C=81=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/ORM.php | 50 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/library/think/ORM.php b/library/think/ORM.php index eb104905..755ffff9 100644 --- a/library/think/ORM.php +++ b/library/think/ORM.php @@ -16,6 +16,56 @@ class ORM protected static $instance = []; protected static $config = []; + /** + * 设置数据对象的值 + * @access public + * @param string $name 名称 + * @param mixed $value 值 + * @return void + */ + public function __set($name, $value) + { + self::__callStatic('__set', [$name, $value]); + } + + /** + * 获取数据对象的值 + * @access public + * @param string $name 名称 + * @return mixed + */ + public function __get($name) + { + return self::__callStatic('__get', [$name]); + } + + /** + * 检测数据对象的值 + * @access public + * @param string $name 名称 + * @return boolean + */ + public function __isset($name) + { + return self::__callStatic('__isset', [$name]); + } + + /** + * 销毁数据对象的值 + * @access public + * @param string $name 名称 + * @return void + */ + public function __unset($name) + { + self::__callStatic('__unset', [$name]); + } + + public function __call($method, $params) + { + return self::__callStatic($method, $params); + } + public static function __callStatic($method, $params) { $name = basename(get_called_class());