minor #22195 [Workflow] Added more PHPDoc (lyrixx)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[Workflow] Added more PHPDoc
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
---
asked by @fabpot / @HeahDude
Commits
-------
97787c6bdc
[Workflow] Added more PHPDoc
This commit is contained in:
commit
cbb0c1809b
@ -36,14 +36,31 @@ class WorkflowExtension extends \Twig_Extension
|
||||
);
|
||||
}
|
||||
|
||||
public function canTransition($object, $transition, $name = null)
|
||||
/**
|
||||
* Returns true if the transition is enabled.
|
||||
*
|
||||
* @param object $subject A subject
|
||||
* @param string $transitionName A transition
|
||||
* @param string $name A workflow name
|
||||
*
|
||||
* @return bool true if the transition is enabled
|
||||
*/
|
||||
public function canTransition($subject, $transitionName, $name = null)
|
||||
{
|
||||
return $this->workflowRegistry->get($object, $name)->can($object, $transition);
|
||||
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
|
||||
}
|
||||
|
||||
public function getEnabledTransitions($object, $name = null)
|
||||
/**
|
||||
* Returns all enabled transitions.
|
||||
*
|
||||
* @param object $subject A subject
|
||||
* @param string $name A workflow name
|
||||
*
|
||||
* @return Transition[] All enabled transitions
|
||||
*/
|
||||
public function getEnabledTransitions($subject, $name = null)
|
||||
{
|
||||
return $this->workflowRegistry->get($object, $name)->getEnabledTransitions($object);
|
||||
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
|
||||
}
|
||||
|
||||
public function hasMarkedPlace($object, $place, $name = null)
|
||||
|
Reference in New Issue
Block a user