/** * Start an item and return current state. * * @param Transition $transition The transition being executed. * @param Context $context The transition context. * @param ErrorCollection $errorCollection The error collection. * @param bool $success The transition success. * * @return State * * @throws WorkflowException If workflow is already started. */ public function start(Transition $transition, Context $context, ErrorCollection $errorCollection, $success) { $this->guardNotStarted(); $state = State::start($this->entityId, $transition, $context, $errorCollection, $success); $this->apply($state); return $state; }