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