选择语言 :

 Module_OOP_ORM::__construct

null Module_OOP_ORM::__construct( )
File: ./modules/oop/orm.class.php
public function __construct($data = null)
{
    # 检查$this->orm_name变量
    if ( !isset($this->_orm_name) )
    {
        $tmpobj = $this;
        while ( $tmpobj )
        {
            if ( is_object($tmpobj) )
            {
                $classname = get_class($tmpobj);
            }
            else
            {
                $classname = (string)$tmpobj;
            }
            if ( preg_match('#^ORM_([a-z0-9_]+)_Finder$#i', $classname, $m) )
            {
                $this->_orm_name = $m[1];
                break;
            }
            else
            {
                $tmpobj = get_parent_class($tmpobj);
            }
        }
        unset($tmpobj);
    }
    if ( !$this->_orm_name )
    {
        throw new Exception('请先定义$this->_orm_name变量');
    }
}