raoul2000\workflow\base\SimpleWorkflowBehavior::initStatus PHP Метод

initStatus() публичный Метод

The status attribute belonging to the owner model is retrieved and if not empty, converted into the corresponding Status object instance. This method does not trigger any event, it is only restoring the model into its workflow. It is invoked when the behavior is attached to the model, and on AFTER_FIND event.
public initStatus ( )
    public function initStatus()
    {
        if ($this->getStatusAccessor() != null) {
            $oStatus = $this->_statusAccessor->readStatus($this->owner);
        } else {
            $oStatus = $this->getOwnerStatus();
        }
        if (!empty($oStatus)) {
            $status = $this->_wfSource->getStatus($oStatus, self::isAttachedTo($this->owner) ? $this->selectDefaultWorkflowId() : null);
            if ($status === null) {
                throw new WorkflowException('Status not found : ' . $oStatus);
            }
            $this->setStatusInternal($status);
        } else {
            $this->_status = null;
        }
    }