File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,20 @@ you can retrieve a workflow from it and use it as follows::
94
94
$workflow->can($blogPost, 'publish'); // True
95
95
$workflow->getEnabledTransitions($blogPost); // $blogPost can perform transition "publish" or "reject"
96
96
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
+
97
111
Learn more
98
112
----------
99
113
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ method returns **false**:
115
115
public static function loadValidatorMetadata(ClassMetadata $metadata)
116
116
{
117
117
$metadata->addGetterConstraint('stateInvalid', new Assert\IsFalse([
118
- 'message' => ' You've entered an invalid state.' ,
118
+ 'message' => " You've entered an invalid state." ,
119
119
]));
120
120
}
121
121
}
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ You can validate each of these constraints sequentially to solve these issues:
120
120
{
121
121
$metadata->addPropertyConstraint('address', new Assert\Sequentially([
122
122
new Assert\NotNull(),
123
- new Assert\Type(" string" ),
123
+ new Assert\Type(' string' ),
124
124
new Assert\Length(['min' => 10]),
125
125
new Assert\Regex(self::ADDRESS_REGEX),
126
126
new AcmeAssert\Geolocalizable(),
You can’t perform that action at this time.
0 commit comments