Neos\Flow\Tests\Functional\Persistence\Fixtures\Post::setComment PHP Method

setComment() public method

public setComment ( $comment ) : void
$comment
return void
    public function setComment($comment)
    {
        $this->comment = $comment;
    }

Usage Example

 /**
  * @test
  */
 public function entitiesWithOwnRepositoryAreNotRemovedIfRelatedRootEntityIsRemoved()
 {
     $comment = new Fixtures\Comment();
     $this->commentRepository->add($comment);
     $post = new Fixtures\Post();
     $post->setComment($comment);
     $this->postRepository->add($post);
     $this->persistenceManager->persistAll();
     $commentIdentifier = $this->persistenceManager->getIdentifierByObject($comment);
     $retrievedComment = $this->persistenceManager->getObjectByIdentifier($commentIdentifier, Fixtures\Comment::class);
     $this->assertSame($comment, $retrievedComment);
     $this->postRepository->remove($post);
     $this->persistenceManager->persistAll();
     $retrievedComment = $this->persistenceManager->getObjectByIdentifier($commentIdentifier, Fixtures\Comment::class);
     $this->assertSame($comment, $retrievedComment);
 }
All Usage Examples Of Neos\Flow\Tests\Functional\Persistence\Fixtures\Post::setComment