|
CI中Mode的构造函数
function Model()
{
// If the magic __get() or __set() methods are used in a Model references can't be used.
$this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE );
// We don't want to assign the model object to itself when using the
// assign_libraries function below so we'll grab the name of the model parent
$this->_parent_name = ucfirst(get_class($this));
log_message('debug', "Model Class Initialized");
}
该句话判断__get和__set函数的存在有何意义?
$this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE ) |
|