Basket::load PHP Method

load() public method

Map current item to matching key/value pair
public load ( $key, $val ) : array
$key string
$val mixed
return array
    function load($key, $val)
    {
        if ($found = $this->find($key, $val)) {
            $this->id = $found[0]->id;
            return $this->item = $found[0]->item;
        }
        $this->reset();
        return [];
    }