- WIP on save and delete forms
This commit is contained in:
1 parent
ad310ffee5
commit
3ce356e1f2
7 files changed
+33
-20
No files matched your search
+1
-8
@@ -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
|
||||
|
||||
Reference in new issue
Block a user