summaryrefslogtreecommitdiff
path: root/platform/www/lib/plugins/refnotes/refnote.php
blob: 127cd181686cf7678d4eddf833436839f26f2041 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php

/**
 * Plugin RefNotes: Common base class for references and notes
 *
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
 * @author     Mykola Ostrovskyy <dwpforge@gmail.com>
 */

////////////////////////////////////////////////////////////////////////////////////////////////////
class refnotes_refnote {

    protected $attributes;
    protected $data;

    /**
     * Constructor
     */
    public function __construct($attributes = array(), $data = array()) {
        $this->attributes = $attributes;
        $this->data = $data;
    }

    /**
     *
     */
    public function getAttributes() {
        return $this->attributes;
    }

    /**
     *
     */
    public function getAttribute($name, $default = '') {
        return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
    }

    /**
     *
     */
    public function getData() {
        return $this->data;
    }

    /**
     *
     */
    public function hasData() {
        return !empty($this->data);
    }
}