4 * This file is a part of dflydev/dot-access-data.
6 * (c) Dragonfly Development Inc.
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Dflydev\DotAccessData;
14 interface DataInterface
17 * Append a value to a key (assumes key refers to an array value)
22 public function append($key, $value = null);
25 * Set a value for a key
30 public function set($key, $value = null);
37 public function remove($key);
40 * Get the raw value for a key
43 * @param mixed $default
47 public function get($key, $default = null);
50 * Check if the key exists
56 public function has($key);
59 * Get a data instance for a key
63 * @return DataInterface
65 public function getData($key);
68 * Import data into existing data
71 * @param bool $clobber
73 public function import(array $data, $clobber = true);
76 * Import data from an external data into existing data
78 * @param DataInterface $data
79 * @param bool $clobber
81 public function importData(DataInterface $data, $clobber = true);
84 * Export data as raw data
88 public function export();