Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / src / Drupal / Driver / DriverInterface.php
1 <?php
2
3 namespace Drupal\Driver;
4
5 /**
6  * Driver interface.
7  */
8 interface DriverInterface {
9
10   /**
11    * Returns a random generator.
12    */
13   public function getRandom();
14
15   /**
16    * Bootstraps operations, as needed.
17    */
18   public function bootstrap();
19
20   /**
21    * Determines if the driver has been bootstrapped.
22    */
23   public function isBootstrapped();
24
25   /**
26    * Creates a user.
27    */
28   public function userCreate(\stdClass $user);
29
30   /**
31    * Deletes a user.
32    */
33   public function userDelete(\stdClass $user);
34
35   /**
36    * Processes a batch of actions.
37    */
38   public function processBatch();
39
40   /**
41    * Adds a role for a user.
42    *
43    * @param \stdClass $user
44    *   A user object.
45    * @param string $role
46    *   The role name to assign.
47    */
48   public function userAddRole(\stdClass $user, $role);
49
50   /**
51    * Retrieves watchdog entries.
52    *
53    * @param int $count
54    *   Number of entries to retrieve.
55    * @param string $type
56    *   Filter by watchdog type.
57    * @param string $severity
58    *   Filter by watchdog severity level.
59    *
60    * @return string
61    *   Watchdog output.
62    */
63   public function fetchWatchdog($count = 10, $type = NULL, $severity = NULL);
64
65   /**
66    * Clears Drupal caches.
67    *
68    * @param string $type
69    *   Type of cache to clear defaults to all.
70    */
71   public function clearCache($type = NULL);
72
73   /**
74    * Clears static Drupal caches.
75    */
76   public function clearStaticCaches();
77
78   /**
79    * Creates a node.
80    *
81    * @param object $node
82    *   Fully loaded node object.
83    *
84    * @return object
85    *   The node object including the node ID in the case of new nodes.
86    */
87   public function createNode($node);
88
89   /**
90    * Deletes a node.
91    *
92    * @param object $node
93    *   Fully loaded node object.
94    */
95   public function nodeDelete($node);
96
97   /**
98    * Runs cron.
99    */
100   public function runCron();
101
102   /**
103    * Creates a taxonomy term.
104    *
105    * @param \stdClass $term
106    *   Term object.
107    *
108    * @return object
109    *   The term object including the term ID in the case of new terms.
110    */
111   public function createTerm(\stdClass $term);
112
113   /**
114    * Deletes a taxonomy term.
115    *
116    * @param \stdClass $term
117    *   Term object to delete.
118    *
119    * @return bool
120    *   Status constant indicating deletion.
121    */
122   public function termDelete(\stdClass $term);
123
124   /**
125    * Creates a role.
126    *
127    * @param array $permissions
128    *   An array of permissions to create the role with.
129    *
130    * @return string
131    *   Role name of newly created role.
132    */
133   public function roleCreate(array $permissions);
134
135   /**
136    * Deletes a role.
137    *
138    * @param string $rid
139    *   A role name to delete.
140    */
141   public function roleDelete($rid);
142
143   /**
144    * Check if the specified field is an actual Drupal field.
145    *
146    * @param string $entity_type
147    *   The entity type to which the field should belong.
148    * @param string $field_name
149    *   The name of the field.
150    *
151    * @return bool
152    *   TRUE if the field exists in the entity type, FALSE if not.
153    */
154   public function isField($entity_type, $field_name);
155
156   /**
157    * Returns a configuration item.
158    *
159    * @param string $name
160    *   The name of the configuration object to retrieve.
161    * @param string $key
162    *   A string that maps to a key within the configuration data.
163    *
164    * @return mixed
165    *   The data that was requested.
166    */
167   public function configGet($name, $key);
168
169   /**
170    * Sets a value in a configuration object.
171    *
172    * @param string $name
173    *   The name of the configuration object.
174    * @param string $key
175    *   Identifier to store value in configuration.
176    * @param mixed $value
177    *   Value to associate with identifier.
178    */
179   public function configSet($name, $key, $value);
180
181 }