Open 4n70w4 opened 4 years ago
symfony/workflow v4.4.2
https://symfony.com/doc/4.4/workflow.html#blocking-transitions
'transitions' => [ 'work'=> [ 'guard' => 'subject.canWork()', 'from' => 'draft', 'to' => 'work', ],
public function canWork() { return false; }
$e = Test::find(34089); $e->workflow_can('work'); // true $e->workflow_apply('work'); dump($e->status); // "status" => "work"
But this method does not call and completely ignores.
https://github.com/symfony/workflow/commit/56696349b428bc34fdd2c0f3148a038aaca1e83e
If you do not want to make support for such a configuration, then at least throw an exception that this is not supported. I had to spend the whole evening to understand why it does not work.
symfony/workflow v4.4.2
https://symfony.com/doc/4.4/workflow.html#blocking-transitions
But this method does not call and completely ignores.