[Workflow] Added more PHPDoc
This commit is contained in:
parent
da7893a7bf
commit
8f090bca12
@ -35,14 +35,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 getName()
|
||||
|
Reference in New Issue
Block a user