@@ 25-62 (lines=38) @@ | ||
22 | * Class MetaParameters |
|
23 | * @package BigBlueButton\Parameters |
|
24 | */ |
|
25 | abstract class MetaParameters extends BaseParameters |
|
26 | { |
|
27 | /** |
|
28 | * @var array |
|
29 | */ |
|
30 | private $meta = []; |
|
31 | ||
32 | /** |
|
33 | * @param $key |
|
34 | * @return mixed |
|
35 | */ |
|
36 | public function getMeta($key) |
|
37 | { |
|
38 | return $this->meta[$key]; |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @param string $key |
|
43 | * @param string $value |
|
44 | * |
|
45 | * @return $this |
|
46 | */ |
|
47 | public function addMeta($key, $value) |
|
48 | { |
|
49 | $this->meta[$key] = $value; |
|
50 | ||
51 | return $this; |
|
52 | } |
|
53 | ||
54 | protected function buildMeta(&$queries) |
|
55 | { |
|
56 | if (count($this->meta) !== 0) { |
|
57 | foreach ($this->meta as $k => $v) { |
|
58 | $queries['meta_' . $k] = $v; |
|
59 | } |
|
60 | } |
|
61 | } |
|
62 | } |
|
63 |
@@ 25-62 (lines=38) @@ | ||
22 | * Class UserDataParameters |
|
23 | * @package BigBlueButton\Parameters |
|
24 | */ |
|
25 | abstract class UserDataParameters extends MetaParameters |
|
26 | { |
|
27 | /** |
|
28 | * @var array |
|
29 | */ |
|
30 | private $userData = []; |
|
31 | ||
32 | /** |
|
33 | * @param $key |
|
34 | * @return mixed |
|
35 | */ |
|
36 | public function getUserData($key) |
|
37 | { |
|
38 | return $this->userData[$key]; |
|
39 | } |
|
40 | ||
41 | /** |
|
42 | * @param string $key |
|
43 | * @param string $value |
|
44 | * |
|
45 | * @return $this |
|
46 | */ |
|
47 | public function addUserData($key, $value) |
|
48 | { |
|
49 | $this->userData[$key] = $value; |
|
50 | ||
51 | return $this; |
|
52 | } |
|
53 | ||
54 | protected function buildUserData(&$queries) |
|
55 | { |
|
56 | if (count($this->userData) !== 0) { |
|
57 | foreach ($this->userData as $k => $v) { |
|
58 | $queries['userdata-' . $k] = $v; |
|
59 | } |
|
60 | } |
|
61 | } |
|
62 | } |
|
63 |