Exemplo n.º 1
0
 protected final function createDocument()
 {
     $author = [new Author('spock'), new Author('kirk'), new Author('scotty')];
     $sut = $this->createRootEntity($author[0]);
     // adding 'like' to the post
     foreach ($author as $a) {
         $sut->addFan($a);
     }
     // adding comments to the post
     foreach ($author as $a) {
         $comm = new Commentary($a);
         $comm->setMessage("a comment from " . $a->getNickname());
         // adding 'like' to each comment
         foreach ($author as $c) {
             $comm->addFan($c);
         }
         $sut->attachCommentary($comm);
     }
     return $sut;
 }