public function set(array $job)
    {
        $result = null;
        $this->hook->attach('job.set.before', $job, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $default = $this->getDefault();
        $result = gplcart_array_merge($default, $job);
        $existing = $this->getSession($result['id']);

        if (!empty($existing)) {
            return (array) $existing;
        }

        $this->setSession($result);
        $this->hook->attach('job.set.after', $job, $result, $this);
        return (array) $result;
    }
public function set(array $job)
    {
        $result = null;
        $this->hook->attach('job.set.before', $job, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $default = $this->getDefault();
        $result = gplcart_array_merge($default, $job);
        $existing = $this->getSession($result['id']);

        if (!empty($existing)) {
            return (array) $existing;
        }

        $this->setSession($result);
        $this->hook->attach('job.set.after', $job, $result, $this);
        return (array) $result;
    }
public function set ( array $ job ) { $ result = null ; $ this -> hook -> attach ( 'job.set.before' , $ job , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( array ) $ result ; } $ default = $ this -> getDefault ( ) ; $ result = gplcart_array_merge ( $ default , $ job ) ; $ existing = $ this -> getSession ( $ result [ 'id' ] ) ; if ( ! empty ( $ existing ) ) { return ( array ) $ existing ; } $ this -> setSession ( $ result ) ; $ this -> hook -> attach ( 'job.set.after' , $ job , $ result , $ this ) ; return ( array ) $ result ; }
Sets a job to the session
@param array $job
@return array
Sets a job to the session