8000 Merge branch '4.4' into 5.1 · githubfromgui/symfony-docs@a24174d · GitHub
[go: up one dir, main page]

Skip to content

Commit a24174d

Browse files
committed
Merge branch '4.4' into 5.1
* 4.4: [Validator] Use double quotes instead of single [Workflow] Added initialization docs
2 parents 0f9fe49 + ccc6f36 commit a24174d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

components/workflow.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ you can retrieve a workflow from it and use it as follows::
9494
$workflow->can($blogPost, 'publish'); // True
9595
$workflow->getEnabledTransitions($blogPost); // $blogPost can perform transition "publish" or "reject"
9696

97+
Initialization
98+
--------------
99+
100+
If the property of your object is ``null`` and you want to set it with the
101+
``initial_marking`` from the configuration, you can call the ``getMarking()``
102+
method to initialize the object property::
103+
104+
// ...
105+
$blogPost = new BlogPost();
106+
$workflow = $registry->get($blogPost);
107+
108+
// initiate workflow
109+
$workflow->getMarking($blogPost);
110+
97111
Learn more
98112
----------
99113

reference/constraints/IsFalse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ method returns **false**:
9797
public static function loadValidatorMetadata(ClassMetadata $metadata)
9898
{
9999
$metadata->addGetterConstraint('stateInvalid', new Assert\IsFalse([
100-
'message' => 'You've entered an invalid state.',
100+
'message' => "You've entered an invalid state.",
101101
]));
102102
}
103103
}

0 commit comments

Comments
 (0)
0