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