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