Add trait for soft-deleted entities
[MAILPOET-2216]
This commit is contained in:
23
lib/Doctrine/EntityTraits/DeletedAtTrait.php
Normal file
23
lib/Doctrine/EntityTraits/DeletedAtTrait.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Doctrine\EntityTraits;
|
||||
|
||||
use DateTimeInterface;
|
||||
|
||||
trait DeletedAtTrait {
|
||||
/**
|
||||
* @Column(type="datetimetz", nullable=true)
|
||||
* @var DateTimeInterface|null
|
||||
*/
|
||||
private $deleted_at;
|
||||
|
||||
/** @return DateTimeInterface|null */
|
||||
function getDeletedAt() {
|
||||
return $this->deleted_at;
|
||||
}
|
||||
|
||||
/** @param DateTimeInterface|null $deleted_at */
|
||||
function setDeletedAt($deleted_at) {
|
||||
$this->deleted_at = $deleted_at;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user