78477edb426f572ed5b4609a9b0018aabfcad512
[yaffs-website] / BootstrapLayouts / BootstrapLayoutsHandlerInterface.php
1 <?php
2
3 namespace Drupal\bootstrap_layouts\Plugin\BootstrapLayouts;
4
5 use Drupal\bootstrap_layouts\BootstrapLayout;
6 use Drupal\Component\Plugin\DerivativeInspectionInterface;
7 use Drupal\Component\Plugin\PluginInspectionInterface;
8 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
9 use Symfony\Component\DependencyInjection\ContainerAwareInterface;
10
11 /**
12  * Interface BootstrapLayoutsHandlerInterface
13  */
14 interface BootstrapLayoutsHandlerInterface extends ContainerAwareInterface, ContainerFactoryPluginInterface, DerivativeInspectionInterface, PluginInspectionInterface {
15
16   /**
17    * Retrieves the human readable label for the plugin.
18    *
19    * @return string
20    *   The human readable label.
21    */
22   public function getLabel();
23
24   /**
25    * Loads a specific layout instance.
26    *
27    * @param string|int $id
28    *   The identifier to load.
29    *
30    * @return \Drupal\bootstrap_layouts\BootstrapLayout
31    *   The BootstrapLayout instance.
32    */
33   public function loadInstance($id);
34
35   /**
36    * Loads layout instances.
37    *
38    * @param string[]|int[] $ids
39    *   Optional. An array of identifiers to load. If no identifiers are
40    *   specified, then all available instances will be loaded.
41    *
42    * @return \Drupal\bootstrap_layouts\BootstrapLayout[]
43    *   An associative array of BootstrapLayout instances, keyed by identifier.
44    */
45   public function loadInstances(array $ids = NULL);
46
47   /**
48    * Saves a specific layout instance.
49    *
50    * @param string|int $id
51    *   The identifier to save.
52    * @param \Drupal\bootstrap_layouts\BootstrapLayout $layout
53    *   The layout instance info array.
54    *
55    * @throws \Drupal\Core\Entity\EntityStorageException
56    *   In case of failures an exception is thrown.
57    */
58   public function saveInstance($id, BootstrapLayout $layout);
59
60   /**
61    * Saves layout instances.
62    *
63    * @param \Drupal\bootstrap_layouts\BootstrapLayout[] $layouts
64    *   An associative array of BootstrapLayout instances, keyed by identifier.
65    *
66    * @throws \Drupal\Core\Entity\EntityStorageException
67    *   In case of failures an exception is thrown.
68    */
69   public function saveInstances(array $layouts = []);
70
71 }