tinternet.net/src/Factory/Blog/PostFactory.php

27 lines
391 B
PHP
Raw Normal View History

2021-03-17 15:57:07 +01:00
<?php
namespace App\Factory\Blog;
use App\Entity\Blog\Post;
use App\Entity\User;
/**
* class PostFactory.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class PostFactory
{
public function create(?User $author = null): Post
{
$entity = new Post();
$entity
->setAuthor($author)
2021-03-17 15:57:20 +01:00
->setStatus(0)
;
2021-03-17 15:57:07 +01:00
return $entity;
}
}