22e7f6992ad4ad3145e2234866f441926f003a1f
[WP-Plugins/glm-member-db-registrations.git] /
1 <?php
2 namespace PayPal\Core;
3 /**
4  * Encapsulates API request information
5  *
6  */
7 class PPRequest {
8         
9         /**
10          * Request Object
11          *
12          * @var object
13          */
14         private $requestObject;
15         
16         /**
17          * Optional credentials associated with
18          * the request
19          * @var ICredential
20          */
21         private $credential;
22                 
23         /**
24          * Transport binding for this request.
25          * Can be NVP, SOAP etc
26          * @var string
27          */
28         private $bindingType;
29
30         /**
31          * 
32          * Holder for any binding specific info
33          * @var array
34          */
35         private $bindingInfo = array();
36         
37         public function __construct($requestObject, $bindingType) {
38                 $this->requestObject = $requestObject;
39                 $this->bindingType = $bindingType;
40         }
41
42         public function getRequestObject() {
43                 return $this->requestObject;
44         }
45         
46         public function getBindingType() {
47                 return $this->bindingType;
48         }
49         
50         public function getBindingInfo($name=NULL) {
51                 if(isset($name)) {
52                         return $this->bindingInfo[$name];
53                 }
54                 return $this->bindingInfo;
55         }
56         
57         /**
58          * 
59          * @param string $name
60          * @param mixed $value
61          */
62         public function addBindingInfo($name, $value) {
63                 $this->bindingInfo[$name] = $value;
64         }
65         
66         public function setCredential($credential) {
67                 $this->credential = $credential;
68         }
69         
70         public function getCredential() {
71                 return $this->credential;
72         }
73 }