3 namespace Drupal\bootstrap_layouts\Plugin\BootstrapLayouts;
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;
12 * Interface BootstrapLayoutsHandlerInterface
14 interface BootstrapLayoutsHandlerInterface extends ContainerAwareInterface, ContainerFactoryPluginInterface, DerivativeInspectionInterface, PluginInspectionInterface {
17 * Retrieves the human readable label for the plugin.
20 * The human readable label.
22 public function getLabel();
25 * Loads a specific layout instance.
27 * @param string|int $id
28 * The identifier to load.
30 * @return \Drupal\bootstrap_layouts\BootstrapLayout
31 * The BootstrapLayout instance.
33 public function loadInstance($id);
36 * Loads layout instances.
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.
42 * @return \Drupal\bootstrap_layouts\BootstrapLayout[]
43 * An associative array of BootstrapLayout instances, keyed by identifier.
45 public function loadInstances(array $ids = NULL);
48 * Saves a specific layout instance.
50 * @param string|int $id
51 * The identifier to save.
52 * @param \Drupal\bootstrap_layouts\BootstrapLayout $layout
53 * The layout instance info array.
55 * @throws \Drupal\Core\Entity\EntityStorageException
56 * In case of failures an exception is thrown.
58 public function saveInstance($id, BootstrapLayout $layout);
61 * Saves layout instances.
63 * @param \Drupal\bootstrap_layouts\BootstrapLayout[] $layouts
64 * An associative array of BootstrapLayout instances, keyed by identifier.
66 * @throws \Drupal\Core\Entity\EntityStorageException
67 * In case of failures an exception is thrown.
69 public function saveInstances(array $layouts = []);