示例#1
0
 private function loadStylesheetConstraintFromCache(DataSource $ds)
 {
     $id = $ds->getId();
     if ($this->cache->test($id)) {
         $stylesheetConstraint = $this->cache->load($id);
     } else {
         $csc = new CachingStylesheetConstraint();
         $csc->setCacheId($id);
         $this->getStylesheetParser()->setRoot($csc);
         $stylesheetConstraint = $this->parseStylesheet($ds);
         $this->cache->save($stylesheetConstraint, $id);
     }
     return $stylesheetConstraint;
 }