Yii:在自定义类中运行方法时,意外调用CHttpSession :: close

strange problem here. Using Yii framework I have the following class

class HtmlTableUi
{
  public function __construct(CWebModule &$module,$data,$actions) 
  {
    //...code goes here...
  }

  protected function renderTable() 
  {
    //... code goes here ...
  }
}

I can call HtmlTableUi::renderTable() from instance of HtmlTableUi in SchedulerModule class which is the main class in a separate application module. My SchedulerModule.php file:

<?php

Yii::import('scheduler.components.HtmlTableUi');

class SchedulerModule extends CWebModule
{
    public function init()
    {
        parent::init();
    }

    public function beforeControllerAction($controller, $action)
    {
        return true;
    }


    public function printUI($data,$actions,$submitPath)
        {
        $ui = new HtmlTableUi($this,$data,$actions,$submitPath);
        $ui->renderTable();
    }
}

Here comes the tricky part - when I call SchudulerModule::printUI from view (index.php) this way

<?php
    $this->module->printUI($casino,$actions,null);
?>

the code flow goes through SchudulerModule::printUI until reaching the point where renderTable is invoked ($ui->renderTable();) and instead stepping at the first line inside the body of that method it, contrary to any logic and rules, surprisingly jumps to CHttpSession::close !!?

Notice the Call Stack before invoking renderTable

protected/modules/scheduler/SchedulerModule.php.SchedulerModule->printUI:153    
protected/modules/scheduler/views/default/index.php.require:21  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CBaseController.php.CBaseController->renderInternal:127 
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CBaseController.php.CBaseController->renderFile:96  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CController.php.CController->renderPartial:870  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CController.php.CController->render:783 
protected/modules/scheduler/controllers/DefaultController.php.DefaultController->actionIndex:57 

and after:

/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CHttpSession.php.CHttpSession->close:134    
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CHttpSession.php.SchedulerModule->printUI:0
protected/modules/scheduler/views/default/index.php.require:21  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CBaseController.php.CBaseController->renderInternal:127 
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CBaseController.php.CBaseController->renderFile:96  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CController.php.CController->renderPartial:870  
/home/default/workspace/src/vlt/web/yii-1.1.12.b600af/framework/web/CController.php.CController->render:783 
protected/modules/scheduler/controllers/DefaultController.php.DefaultController->actionIndex:57 

Has anyone had similar issue? Can anyone explain that behavior?

I found the solution!!! The access modifier of renderTable is supposed to be public, not protected. This wrong somehow in Yii framework results in unexpected runtime behavior instead of compilation error.