public function JobQueue::__construct

Set up a new JobItemCart instance.

Will load the queue from the session or initialize a new one if nothing has been stored yet.

File

src/JobQueue.php, line 47

Class

JobQueue
Represents a job (checkout) queue.

Namespace

Drupal\tmgmt

Code

public function __construct() {
  if (!isset($_SESSION[$this->session_key])) {
    $_SESSION[$this->session_key] = [
      'queue' => [],
      'processed' => 0,
      'destination' => NULL,
    ];
  }
  $this->queue =& $_SESSION[$this->session_key]['queue'];
  $this->processed =& $_SESSION[$this->session_key]['processed'];
  $this->destination =& $_SESSION[$this->session_key]['destination'];
}