예제 #1
0
 protected function fillContentStreams(PageRole $page)
 {
     $csClass = $this->container->getRoleFQN('ContentStream');
     $types = array('page-content', 'sidebar-content');
     // per default haben wir immer einen content-stream pro sprache für page-content und einen für die sidebar
     foreach ($this->container->getLanguages() as $lang) {
         foreach ($types as $type) {
             $streams = $page->getContentStream()->locale($lang)->type($type)->revision($this->defaultRevision)->collection();
             if (count($streams) == 0) {
                 $cs = $csClass::create($lang, $type, $this->defaultRevision);
                 $page->addContentStream($cs);
                 $this->dc->getEntityManager()->persist($cs);
             }
         }
     }
 }