Entity/BaseOrder.php
public function setStatus($status)
    {
        // We keep the previous state for handling the change of state
        if ($this->state !== $status) {
            $this->setPreviousState($this->getState());
        }

        $this->state = $status;

        return $this;
    }
public function setStatus($status)
    {
        // We keep the previous state for handling the change of state
        if ($this->state !== $status) {
            $this->setPreviousState($this->getState());
        }

        $this->state = $status;

        return $this;
    }
@param string $status

@return $this