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