Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions workflow/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ you can get the workflow by injecting the Workflow registry service::
use Symfony\Component\Workflow\Registry;
use App\Entity\BlogPost;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\Exception\TransitionException;

class BlogController extends Controller
{
Expand All @@ -200,7 +200,7 @@ you can get the workflow by injecting the Workflow registry service::
// Update the currentState on the post
try {
$workflow->apply($post, 'to_review');
} catch (LogicException $exception) {
} catch (TransitionException $exception) {
// ... if the transition is not allowed
}

Expand All @@ -209,6 +209,10 @@ you can get the workflow by injecting the Workflow registry service::
}
}

.. versionadded:: 4.1
The :class:`Symfony\\Component\\Workflow\\Exception\\TransitionException`
class was introduced in Symfony 4.1.

Using Events
------------

Expand Down