<?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;
    }
}
