ORM类支持实例化

This commit is contained in:
thinkphp
2016-01-23 15:36:37 +08:00
parent 9f383a83bf
commit f05ee71680

View File

@@ -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());