1<?php
2
3/**
4 * Plugin RefNotes: Common base class for references and notes
5 *
6 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author     Mykola Ostrovskyy <dwpforge@gmail.com>
8 */
9
10////////////////////////////////////////////////////////////////////////////////////////////////////
11class refnotes_refnote {
12
13    protected $attributes;
14    protected $data;
15
16    /**
17     * Constructor
18     */
19    public function __construct($attributes = array(), $data = array()) {
20        $this->attributes = $attributes;
21        $this->data = $data;
22    }
23
24    /**
25     *
26     */
27    public function getAttributes() {
28        return $this->attributes;
29    }
30
31    /**
32     *
33     */
34    public function getAttribute($name, $default = '') {
35        return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
36    }
37
38    /**
39     *
40     */
41    public function getData() {
42        return $this->data;
43    }
44
45    /**
46     *
47     */
48    public function hasData() {
49        return !empty($this->data);
50    }
51}
52