set_status() public method

Set order status.
Since: 2.7.0
public set_status ( string $new_status ) : array
$new_status string Status to change the order to. No internal wc- prefix is required.
return array details of change
 /**
  * Set order status.
  * @since 2.7.0
  * @param string $new_status Status to change the order to. No internal wc- prefix is required.
  * @param string $note (default: '') Optional note to add.
  * @param bool $manual_update is this a manual order status change?
  * @param array details of change
  */
 public function set_status($new_status, $note = '', $manual_update = false)
 {
     $result = parent::set_status($new_status);
     if (!empty($result['from']) && $result['from'] !== $result['to']) {
         $this->_status_transition = array('from' => !empty($this->_status_transition['from']) ? $this->_status_transition['from'] : $result['from'], 'to' => $result['to'], 'note' => $note, 'manual' => (bool) $manual_update);
         if ('pending' === $result['from'] && !$manual_update) {
             $this->set_date_paid(current_time('timestamp'));
         }
         if ('completed' === $result['to']) {
             $this->set_date_completed(current_time('timestamp'));
         }
     }
     return $result;
 }