deblan.io-murph/src/Factory/Blog/CommentFactory.php
2021-03-30 20:40:36 +02:00

27 lines
402 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;
}
}