PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260805
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260805
260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 All 189 releases
s2member / src / includes / externals / aweber / aweber_response.php

aweber_response.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 260805, at src/includes/externals/aweber/aweber_response.php

73 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // @codingStandardsIgnoreFile
3
4 /**
5 * AWeberResponse
6 *
7 * Base class for objects that represent a response from the AWeberAPI.
8 * Responses will exist as one of the two AWeberResponse subclasses:
9 * - AWeberEntry - a single instance of an AWeber resource
10 * - AWeberCollection - a collection of AWeber resources
11 * @uses AWeberAPIBase
12 * @package
13 * @version $id$
14 */
15 class AWeberResponse extends AWeberAPIBase {
16
17 public $adapter = false;
18 public $data = array();
19 public $_dynamicData = array();
20
21 /**
22 * __construct
23 *
24 * Creates a new AWeberRespones
25 *
26 * @param mixed $response Data returned by the API servers
27 * @param mixed $url URL we hit to get the data
28 * @param mixed $adapter OAuth adapter used for future interactions
29 * @access public
30 * @return void
31 */
32 public function __construct($response, $url, $adapter) {
33 $this->adapter = $adapter;
34 $this->url = $url;
35 $this->data = $response;
36 }
37
38 /**
39 * __set
40 *
41 * Manual re-implementation of __set, allows sub classes to access
42 * the default behavior by using the parent:: format.
43 *
44 * @param mixed $key Key of the attr being set
45 * @param mixed $value Value being set to the attr
46 * @access public
47 */
48 public function __set($key, $value) {
49 $this->{$key} = $value;
50 }
51
52 /**
53 * __get
54 *
55 * PHP "MagicMethod" to allow for dynamic objects. Defers first to the
56 * data in $this->data.
57 *
58 * @param String $value Name of the attribute requested
59 * @access public
60 * @return mixed
61 */
62 public function __get($value) {
63 if (in_array($value, $this->_privateData)) {
64 return null;
65 }
66 if (array_key_exists($value, $this->data)) {
67 return $this->data[$value];
68 }
69 if ($value == 'type') return $this->_type();
70 }
71
72 }
73