public function JobItemCart::__construct

Set up a new JobItemCart instance.

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

File

src/JobItemCart.php, line 34

Class

JobItemCart
Represents a job item cart.

Namespace

Drupal\tmgmt

Code

public function __construct() {
  if (!isset($_SESSION[$this->session_key])) {
    $_SESSION[$this->session_key] = array();
  }
  $this->cart =& $_SESSION[$this->session_key];
}