Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 namespace Drupal\locale;
|
Chris@0
|
4
|
Chris@0
|
5 /**
|
Chris@0
|
6 * Defines the locale project storage interface.
|
Chris@0
|
7 */
|
Chris@0
|
8 interface LocaleProjectStorageInterface {
|
Chris@0
|
9
|
Chris@0
|
10 /**
|
Chris@0
|
11 * Returns the stored value for a given key.
|
Chris@0
|
12 *
|
Chris@0
|
13 * @param string $key
|
Chris@0
|
14 * The key of the data to retrieve.
|
Chris@0
|
15 * @param mixed $default
|
Chris@0
|
16 * The default value to use if the key is not found.
|
Chris@0
|
17 *
|
Chris@0
|
18 * @return mixed
|
Chris@0
|
19 * The stored value, or the default value if no value exists.
|
Chris@0
|
20 */
|
Chris@0
|
21 public function get($key, $default = NULL);
|
Chris@0
|
22
|
Chris@0
|
23 /**
|
Chris@0
|
24 * Returns a list of project records.
|
Chris@0
|
25 *
|
Chris@0
|
26 * @param array $keys
|
Chris@0
|
27 * A list of keys to retrieve.
|
Chris@0
|
28 *
|
Chris@0
|
29 * @return array
|
Chris@0
|
30 * An associative array of items successfully returned, indexed by key.
|
Chris@0
|
31 */
|
Chris@0
|
32 public function getMultiple(array $keys);
|
Chris@0
|
33
|
Chris@0
|
34 /**
|
Chris@0
|
35 * Creates or updates the project record.
|
Chris@0
|
36 *
|
Chris@0
|
37 * @param string $key
|
Chris@0
|
38 * The key of the data to store.
|
Chris@0
|
39 * @param mixed $value
|
Chris@0
|
40 * The data to store.
|
Chris@0
|
41 */
|
Chris@0
|
42 public function set($key, $value);
|
Chris@0
|
43
|
Chris@0
|
44 /**
|
Chris@0
|
45 * Creates or updates multiple project records.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @param array $data
|
Chris@0
|
48 * An associative array of key/value pairs.
|
Chris@0
|
49 */
|
Chris@0
|
50 public function setMultiple(array $data);
|
Chris@0
|
51
|
Chris@0
|
52 /**
|
Chris@0
|
53 * Deletes project records for a given key.
|
Chris@0
|
54 *
|
Chris@0
|
55 * @param string $key
|
Chris@0
|
56 * The key of the data to delete.
|
Chris@0
|
57 */
|
Chris@0
|
58 public function delete($key);
|
Chris@0
|
59
|
Chris@0
|
60 /**
|
Chris@0
|
61 * Deletes multiple project records.
|
Chris@0
|
62 *
|
Chris@0
|
63 * @param array $keys
|
Chris@0
|
64 * A list of item names to delete.
|
Chris@0
|
65 */
|
Chris@0
|
66 public function deleteMultiple(array $keys);
|
Chris@0
|
67
|
Chris@0
|
68 /**
|
Chris@0
|
69 * Returns all the project records.
|
Chris@0
|
70 *
|
Chris@0
|
71 * @return array
|
Chris@0
|
72 * An associative array of items successfully returned, indexed by key.
|
Chris@0
|
73 */
|
Chris@0
|
74 public function getAll();
|
Chris@0
|
75
|
Chris@0
|
76 /**
|
Chris@0
|
77 * Deletes all projects records.
|
Chris@0
|
78 *
|
Chris@0
|
79 * @return array
|
Chris@0
|
80 * An associative array of items successfully returned, indexed by key.
|
Chris@0
|
81 */
|
Chris@0
|
82 public function deleteAll();
|
Chris@0
|
83
|
Chris@0
|
84 /**
|
Chris@0
|
85 * Mark all projects as disabled.
|
Chris@0
|
86 */
|
Chris@0
|
87 public function disableAll();
|
Chris@0
|
88
|
Chris@0
|
89 /**
|
Chris@0
|
90 * Resets the project storage cache.
|
Chris@0
|
91 */
|
Chris@0
|
92 public function resetCache();
|
Chris@0
|
93
|
Chris@0
|
94 /**
|
Chris@0
|
95 * Returns the count of project records.
|
Chris@0
|
96 *
|
Chris@0
|
97 * @return int
|
Chris@0
|
98 * The number of saved items.
|
Chris@0
|
99 */
|
Chris@0
|
100 public function countProjects();
|
Chris@0
|
101
|
Chris@0
|
102 }
|