Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
State.php
Go to the documentation of this file.
1 <?php
8 
9 class State implements StateInterface
10 {
16  protected $isEnabled = true;
17 
21  protected $storedStatus;
22 
28  public function disable()
29  {
30  $this->isEnabled = false;
31  }
32 
38  public function enable()
39  {
40  $this->isEnabled = true;
41  }
42 
48  public function isEnabled()
49  {
50  return $this->isEnabled;
51  }
52 
62  public function suspend($status = false)
63  {
64  if ($this->storedStatus === null) {
65  $this->storedStatus = $this->isEnabled;
66  $this->isEnabled = $status;
67  }
68  }
69 
79  public function resume($status = true)
80  {
82  $this->storedStatus = null;
83  }
84 }
$status
Definition: order_status.php:8