PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260917
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260917
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 260917, at src/includes/externals/aweber/aweber_response.php

75 lines 2.0 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 //260816 AWeber response objects intentionally expose dynamic API properties; opt in explicitly on PHP 8.2+.
16 #[\AllowDynamicProperties]
17 class AWeberResponse extends AWeberAPIBase {
18
19 public $adapter = false;
20 public $data = array();
21 public $_dynamicData = array();
22
23 /**
24 * __construct
25 *
26 * Creates a new AWeberRespones
27 *
28 * @param mixed $response Data returned by the API servers
29 * @param mixed $url URL we hit to get the data
30 * @param mixed $adapter OAuth adapter used for future interactions
31 * @access public
32 * @return void
33 */
34 public function __construct($response, $url, $adapter) {
35 $this->adapter = $adapter;
36 $this->url = $url;
37 $this->data = $response;
38 }
39
40 /**
41 * __set
42 *
43 * Manual re-implementation of __set, allows sub classes to access
44 * the default behavior by using the parent:: format.
45 *
46 * @param mixed $key Key of the attr being set
47 * @param mixed $value Value being set to the attr
48 * @access public
49 */
50 public function __set($key, $value) {
51 $this->{$key} = $value;
52 }
53
54 /**
55 * __get
56 *
57 * PHP "MagicMethod" to allow for dynamic objects. Defers first to the
58 * data in $this->data.
59 *
60 * @param String $value Name of the attribute requested
61 * @access public
62 * @return mixed
63 */
64 public function __get($value) {
65 if (in_array($value, $this->_privateData)) {
66 return null;
67 }
68 if (array_key_exists($value, $this->data)) {
69 return $this->data[$value];
70 }
71 if ($value == 'type') return $this->_type();
72 }
73
74 }
75