deblan.io-murph/src/Factory/Blog/CommentFactory.php
Simon Vieille 472e254a5f add comments
Signed-off-by: Simon Vieille <simon@deblan.fr>
2021-03-30 13:40:38 +02:00

26 lines
393 B
PHP

<?php
namespace App\Factory\Blog;
use App\Entity\Blog\Comment;
use App\Entity\Blog\Post;
/**
* class CommentFactory.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class CommentFactory
{
public function create(Post $post): Comment
{
$entity = new Comment();
$entity
->setPost($post)
->setIsActive(true);
return $entity;
}
}