- WIP on save and delete forms

This commit is contained in:
Dave Mc Nicoll committed 2025-04-25 20:08:52 +00:00
1 parent ad310ffee5
commit 3ce356e1f2
7 files changed
+33 -20

No files matched your search

+1 -8
View File
@@ -9,13 +9,6 @@ use Ulmus\Entity\EntityInterface;
abstract class Delete implements \Picea\Ui\Method\FormInterface {
use FormTrait;
public function getEntity() : EntityInterface
{
return $this->entity;
}
public function initialize(FormContextInterface $context) : void {}
public function validate(FormContextInterface $context) : bool
{
if ( ! $this->entity->isLoaded() ) {
@@ -24,7 +17,7 @@ abstract class Delete implements \Picea\Ui\Method\FormInterface {
));
}
return $context->valid();
return $context->valid($this->getEntity()->isLoaded() ? $this->getEntity() : null);
}
public function execute(FormContextInterface $context) : void