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_entry_data_array.php

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

66 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // @codingStandardsIgnoreFile
3
4 class AWeberEntryDataArray implements ArrayAccess, Countable, Iterator {
5 private $counter = 0;
6
7 protected $data;
8 protected $keys;
9 protected $name;
10 protected $parent;
11
12 public function __construct($data, $name, $parent) {
13 $this->data = $data;
14 $this->keys = array_keys($data);
15 $this->name = $name;
16 $this->parent = $parent;
17 }
18
19 public function count() {
20 return sizeOf($this->data);
21 }
22
23 public function offsetExists($offset) {
24 return (isset($this->data[$offset]));
25 }
26
27 public function offsetGet($offset) {
28 return $this->data[$offset];
29 }
30
31 public function offsetSet($offset, $value) {
32 $this->data[$offset] = $value;
33 $this->parent->{$this->name} = $this->data;
34 return $value;
35 }
36
37 public function offsetUnset($offset) {
38 unset($this->data[$offset]);
39 }
40
41 public function rewind() {
42 $this->counter = 0;
43 }
44
45 public function current() {
46 return $this->data[$this->key()];
47 }
48
49 public function key() {
50 return $this->keys[$this->counter];
51 }
52
53 public function next() {
54 $this->counter++;
55 }
56
57 public function valid() {
58 if ($this->counter >= sizeOf($this->data)) {
59 return false;
60 }
61 return true;
62 }
63
64
65 }
66