SoftDeletable
Provides methods for deleting entities.
Table of Contents
- $deletedAt : mixed
- delete() : mixed
- Deletes the entity.
- getDeletedAt() : DateTime
- Returns when the entry got deleted.
- isDeleted() : bool
- Returns true if this entity is soft deleted.
- restore() : mixed
- Restores an entity back.
- setDeletedAt() : mixed
- Sets deletedAt to a specific date.
Properties
$deletedAt
private
mixed
$deletedAt
Tags
Methods
delete()
Deletes the entity.
public
delete(EntityManagerInterface $em) : mixed
Parameters
- $em : EntityManagerInterface
Return values
mixed —getDeletedAt()
Returns when the entry got deleted.
public
getDeletedAt() : DateTime
Return values
DateTime —isDeleted()
Returns true if this entity is soft deleted.
public
isDeleted() : bool
Return values
bool —restore()
Restores an entity back.
public
restore(EntityManagerInterface $em) : mixed
Parameters
- $em : EntityManagerInterface
Return values
mixed —setDeletedAt()
Sets deletedAt to a specific date.
public
setDeletedAt([DateTime|null $deletedAt = null ]) : mixed
Parameters
- $deletedAt : DateTime|null = null