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

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

TRUE is returned when : - $status is empty and the owner model has no current status - $status is not empty and refers to the same status as the current one All other condition return FALSE. This method can be invoked passing a string or a Status instance argument. Example :
    $post->statusEquals('draft');
	   $post->statusEquals($otherPost->getWorkflowStatus());
public statusEquals ( Status | string $status = null ) : boolean
$status Status | string the status to test
Результат boolean
    public function statusEquals($status = null)
    {
        if (!empty($status)) {
            try {
                $oStatus = $this->ensureStatusInstance($status);
            } catch (Exception $e) {
                return false;
            }
        } else {
            $status = $oStatus = null;
        }
        if ($oStatus == null) {
            return !$this->hasWorkflowStatus();
        } elseif ($this->hasWorkflowStatus()) {
            return $this->getWorkflowStatus()->getId() == $oStatus->getId();
        } else {
            return false;
        }
    }