3498f26e571316c4a03b4ec6d70968db0e32aad9
[yaffs-website] / vendor / dflydev / dot-access-data / src / Dflydev / DotAccessData / DataInterface.php
1 <?php
2
3 /*
4  * This file is a part of dflydev/dot-access-data.
5  *
6  * (c) Dragonfly Development Inc.
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Dflydev\DotAccessData;
13
14 interface DataInterface
15 {
16     /**
17      * Append a value to a key (assumes key refers to an array value)
18      *
19      * @param string $key
20      * @param mixed  $value
21      */
22     public function append($key, $value = null);
23
24     /**
25      * Set a value for a key
26      *
27      * @param string $key
28      * @param mixed  $value
29      */
30     public function set($key, $value = null);
31
32     /**
33      * Remove a key
34      *
35      * @param string $key
36      */
37     public function remove($key);
38
39     /**
40      * Get the raw value for a key
41      *
42      * @param string $key
43      * @param mixed $default
44      *
45      * @return mixed
46      */
47     public function get($key, $default = null);
48
49     /**
50      * Check if the key exists
51      *
52      * @param string $key
53      *
54      * @return bool
55      */
56     public function has($key);
57
58     /**
59      * Get a data instance for a key
60      *
61      * @param string $key
62      *
63      * @return DataInterface
64      */
65     public function getData($key);
66
67     /**
68      * Import data into existing data
69      *
70      * @param array $data
71      * @param bool  $clobber
72      */
73     public function import(array $data, $clobber = true);
74
75     /**
76      * Import data from an external data into existing data
77      *
78      * @param DataInterface $data
79      * @param bool          $clobber
80      */
81     public function importData(DataInterface $data, $clobber = true);
82
83     /**
84      * Export data as raw data
85      *
86      * @return array
87      */
88     public function export();
89 }