示例#1
0
 protected function createAlbums(Tx_Yag_Domain_Model_Gallery $gallery)
 {
     $albumRepository = $this->objectManager->get('Tx_Yag_Domain_Repository_AlbumRepository');
     /* @var $albumRepository Tx_Yag_Domain_Repository_AlbumRepository */
     $first = true;
     for ($i = 1; $i <= $this->albumsPerGalleryCount; $i++) {
         $album = new Tx_Yag_Domain_Model_Album();
         $album->setName('TestAlbum ' . $i);
         $album->setDescription('Created on ' . date('d.m.Y H:i:s'));
         $album->setGallery($gallery);
         $albumRepository->add($album);
         if ($first) {
             $gallery->setThumbAlbum($album);
             $first = FALSE;
         }
         $this->createItems($album);
     }
 }