/**
  * Сериализовать бин на диск
  *
  * @param CStatefullBean $bean
  */
 public function serializeBean(CStatefullBean $bean)
 {
     if (file_exists($this->cacheDir . $bean->getBeanId())) {
         unlink($this->cacheDir . $bean->getBeanId());
     }
     file_put_contents($this->cacheDir . $bean->getBeanId(), serialize($bean));
 }
 /**
  * Сериализовать бин на диск
  *
  * @param CStatefullBean $bean
  */
 public function serializeBean(CStatefullBean $bean)
 {
     if (is_a(CApp::getApp()->getApp(), "CCacheDummy")) {
         if (file_exists($this->cacheDir . $bean->getBeanId())) {
             unlink($this->cacheDir . $bean->getBeanId());
         }
         file_put_contents($this->cacheDir . $bean->getBeanId(), serialize($bean));
     } else {
         CApp::getApp()->cache->set("bean_" . $bean->getBeanId(), $bean);
     }
 }