Example #1
0
 /**
  * @return WikiRepository
  */
 public function getRepository()
 {
     $self = $this;
     return Lazy::init($this->_repository, function () use($self) {
         return WikiRepository::model()->find('ownerId = :ownerId', array(':ownerId' => $self->id));
     });
 }
Example #2
0
 /**
  * @return array of WikiPages
  */
 public function getPages()
 {
     $self = $this;
     return Lazy::init($this->_pages, function () use($self) {
         $pages = array();
         foreach (FileFinder::find($self->path, ['fileExt' => WikiRepository::getAvailableFileTypes()]) as $file) {
             $pages[] = $self->getPageByName($file, false);
         }
         return $pages;
     });
 }