StateMachine
class StateMachine extends Workflow
Методы
| __construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed') | ||
| Marking | getMarking(object $subject) Возвращает Marking объекта. | из Workflow |
| bool | can(object $subject, string $transitionName) Возвращает true, если переход разрешен. | из Workflow |
| TransitionBlockerList | buildTransitionBlockerList($subject, string $transitionName) Создаёт TransitionBlockerList, чтобы узнать, почему переход заблокирован. | из Workflow |
| Marking | apply(object $subject, string $transitionName) Выполняет переход. | из Workflow |
| Transition[] | getEnabledTransitions(object $subject) Возвращает все разрешенные переходы. | из Workflow |
| string | getName() | из Workflow |
| Definition | getDefinition() | из Workflow |
| MarkingStoreInterface | getMarkingStore() | из Workflow |
| MetadataStoreInterface | getMetadataStore() | из Workflow |
Подробности
__construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')
Параметры
| Definition | $definition | |
| MarkingStoreInterface | $markingStore | |
| EventDispatcherInterface | $dispatcher | |
| string | $name |
Marking getMarking(object $subject)
Возвращает Marking объекта.
Параметры
| object | $subject | Объект |
Возвращаемое значение
| Marking | Marking |
Исключения
| LogicException |
bool can(object $subject, string $transitionName)
Возвращает true, если переход разрешен.
Параметры
| object | $subject | Объект |
| string | $transitionName | Переход |
Возвращаемое значение
| bool | true, если переход разрешен |
TransitionBlockerList buildTransitionBlockerList($subject, string $transitionName)
Создаёт TransitionBlockerList, чтобы узнать, почему переход заблокирован.
Параметры
| $subject | ||
| string | $transitionName |
Возвращаемое значение
| TransitionBlockerList |
Marking apply(object $subject, string $transitionName)
Выполняет переход.
Параметры
| object | $subject | Объект |
| string | $transitionName | Переход |
Возвращаемое значение
| Marking | Новый Marking |
Исключения
| LogicException | Если переход неприменим |
Transition[] getEnabledTransitions(object $subject)
Возвращает все разрешенные переходы.
Параметры
| object | $subject | Объект |
Возвращаемое значение
| Transition[] | Все разрешенные переходы |
string getName()
Возвращаемое значение
| string |
Definition getDefinition()
Возвращаемое значение
| Definition |
MarkingStoreInterface getMarkingStore()
Возвращаемое значение
| MarkingStoreInterface |
MetadataStoreInterface getMetadataStore()
Возвращаемое значение
| MetadataStoreInterface |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Workflow/StateMachine.html