Deleter
in package
implements
IPostDeleter
Post deletion service.
Handles safe deletion of posts.
Table of Contents
Interfaces
- IPostDeleter
- Post deleter service interface
Properties
Methods
- __construct() : mixed
- delete() : bool
- Delete a post
- deleteById() : bool
- Delete a post by ID
Properties
$_postRepository
private
IPostRepository
$_postRepository
Methods
__construct()
public
__construct(IPostRepository $postRepository) : mixed
Parameters
- $postRepository : IPostRepository
delete()
Delete a post
public
delete(Post $post) : bool
Parameters
- $post : Post
-
The post to delete
Return values
bool —True if deleted successfully
deleteById()
Delete a post by ID
public
deleteById(int $id) : bool
Parameters
- $id : int
-
Post ID
Return values
bool —True if deleted successfully