9daf2865c46177de26ae411c28b23ad4d7fb954c
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Provider / ProviderInterface.php
1 <?php
2
3 namespace Drupal\bootstrap\Plugin\Provider;
4
5 use Drupal\Component\Plugin\DerivativeInspectionInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7
8 /**
9  * ProviderInterface.
10  *
11  * @ingroup plugins_provider
12  */
13 interface ProviderInterface extends PluginInspectionInterface, DerivativeInspectionInterface {
14
15   /**
16    * Retrieves the API URL if set.
17    *
18    * @return string
19    *   The API URL.
20    */
21   public function getApi();
22
23   /**
24    * Retrieves Provider assets for the active provider, if any.
25    *
26    * @param string|array $types
27    *   The type of asset to retrieve: "css" or "js", defaults to an array
28    *   array containing both if not set.
29    *
30    * @return array
31    *   If $type is a string or an array with only one (1) item in it, the
32    *   assets are returned as an indexed array of files. Otherwise, an
33    *   associative array is returned keyed by the type.
34    */
35   public function getAssets($types = NULL);
36
37   /**
38    * Retrieves the provider description.
39    *
40    * @return string
41    *   The provider description.
42    */
43   public function getDescription();
44
45   /**
46    * Retrieves the provider human-readable label.
47    *
48    * @return string
49    *   The provider human-readable label.
50    */
51   public function getLabel();
52
53   /**
54    * Retrieves the themes supported by the CDN provider.
55    *
56    * @return array
57    *   An array of themes. If the CDN provider does not support any it will
58    *   just be an empty array.
59    */
60   public function getThemes();
61
62   /**
63    * Retrieves the versions supported by the CDN provider.
64    *
65    * @return array
66    *   An array of versions. If the CDN provider does not support any it will
67    *   just be an empty array.
68    */
69   public function getVersions();
70
71   /**
72    * Flag indicating that the API data parsing failed.
73    *
74    * @return bool
75    *   TRUE or FALSE
76    */
77   public function hasError();
78
79   /**
80    * Flag indicating that the API data was manually imported.
81    *
82    * @return bool
83    *   TRUE or FALSE
84    */
85   public function isImported();
86
87   /**
88    * Processes the provider plugin definition upon discovery.
89    *
90    * @param array $definition
91    *   The provider plugin definition.
92    * @param string $plugin_id
93    *   The plugin identifier.
94    */
95   public function processDefinition(array &$definition, $plugin_id);
96
97   /**
98    * Processes the provider plugin definition upon discovery.
99    *
100    * @param array $json
101    *   The JSON data retrieved from the API request.
102    * @param array $definition
103    *   The provider plugin definition.
104    */
105   public function processApi(array $json, array &$definition);
106
107 }