public function setKey($key = null)
    {
        if (empty($key)) {

            $key = $this->get('private_key');

            if (empty($key)) {
                $key = gplcart_string_random();
                $this->set('private_key', $key);
            }

        } else {
            $this->set('private_key', $key);
        }

        return $this->key = $key;
    }
public function setKey($key = null)
    {
        if (empty($key)) {

            $key = $this->get('private_key');

            if (empty($key)) {
                $key = gplcart_string_random();
                $this->set('private_key', $key);
            }

        } else {
            $this->set('private_key', $key);
        }

        return $this->key = $key;
    }
public function setKey ( $ key = null ) { if ( empty ( $ key ) ) { $ key = $ this -> get ( 'private_key' ) ; if ( empty ( $ key ) ) { $ key = gplcart_string_random ( ) ; $ this -> set ( 'private_key' , $ key ) ; } } else { $ this -> set ( 'private_key' , $ key ) ; } return $ this -> key = $ key ; }
Sets the private key
@param null|string $key
@return string
Sets the private key