Refactor Forms::trash() to use Doctrine
[MAILPOET-3039]
This commit is contained in:
@ -4,6 +4,7 @@ namespace MailPoet\Form;
|
||||
|
||||
use MailPoet\Doctrine\Repository;
|
||||
use MailPoet\Entities\FormEntity;
|
||||
use MailPoetVendor\Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* @extends Repository<FormEntity>
|
||||
@ -34,4 +35,10 @@ class FormsRepository extends Repository {
|
||||
->getQuery()
|
||||
->getSingleScalarResult();
|
||||
}
|
||||
|
||||
public function trash(FormEntity $form) {
|
||||
$form->setDeletedAt(Carbon::now());
|
||||
$this->persist($form);
|
||||
$this->flush();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user