Naguro_Request

The WooCommerce Naguro Connect Naguro Request class.

Defined (1)

The class is defined in the following location(s).

/includes/naguro/abstracts/abstract-request.php  
  1. abstract class Naguro_Request implements Naguro_Request_Interface { 
  2. /** @var array */ 
  3. protected $params; 
  4.  
  5. /** @var Naguro_Session_Model */ 
  6. protected $session; 
  7.  
  8. /** @var Naguro_API_Handler */ 
  9. protected $handler; 
  10.  
  11. /** 
  12. * Fire up the required session and handler 
  13. * @param $params array 
  14. */ 
  15. public function __construct( $params ) { 
  16. $this->params = $params; 
  17.  
  18. if ( ! isset( $this->params['session'] ) && ! isset( $this->params['session_id'] ) ) { 
  19. $this->session = new Naguro_Session_Model(); 
  20. } else { 
  21. // This variable needs to be available with both keys. Don't ask. 
  22. if ( isset( $this->params['session'] ) ) { 
  23. $this->params['session_id'] = $this->params['session']; 
  24.  
  25. $this->session = new Naguro_Session_Model( $this->params['session_id'] ); 
  26.  
  27. $this->handler = Naguro_API_Handlers_Repository::get_handler();