Completed
Push — master ( 273074...8cf231 )
by Ghazi
02:28
created

MetaParameters::getMeta()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * BigBlueButton open source conferencing system - http://www.bigbluebutton.org/.
4
 *
5
 * Copyright (c) 2016 BigBlueButton Inc. and by respective authors (see below).
6
 *
7
 * This program is free software; you can redistribute it and/or modify it under the
8
 * terms of the GNU Lesser General Public License as published by the Free Software
9
 * Foundation; either version 3.0 of the License, or (at your option) any later
10
 * version.
11
 *
12
 * BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14
 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License along
17
 * with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18
 */
19
namespace BigBlueButton\Parameters;
20
21
/**
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 setMeta($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