4 * Contains \Drupal\bootstrap\Plugin\Update\UpdateInterface.
7 namespace Drupal\bootstrap\Plugin\Update;
9 use Drupal\bootstrap\Theme;
12 * Defines the interface for an object oriented preprocess plugin.
14 * @ingroup plugins_update
16 interface UpdateInterface {
19 * Retrieves the update description, if any.
22 * The update description.
24 public function getDescription();
27 * Retrieves the human-readable label for the update.
32 public function getLabel();
35 * Retrieves the update schema.
39 public function getProvider();
42 * Retrieves the update schema.
46 public function getSchema();
49 * Retrieves the update severity level.
52 * The update severity level.
54 public function getSeverity();
57 * Retrieves the theme that provided the update.
59 * Used to determine whether or not the update should apply only to itself
60 * (the theme that implemented the plugin) and none of its sub-themes.
62 * @return \Drupal\bootstrap\Theme
64 public function getTheme();
67 * Indicates whether or not the update is private.
71 public function isPrivate();
74 * The batch process callback for the update.
76 * This is the bulk of the update plugin. Be careful to no fill it will a
77 * lot of heavily intensive processing. If you need to do a lot of things,
78 * split it up into multiple updates so the Batch API can handle it.
80 * You can throw an exception from this method in case your processing fails.
81 * Its message will be conveyed to the user to indicate what went wrong. If
82 * the update has failed, but do not wish to throw an exception, simply
83 * return FALSE and a generic "Update failed" message will appear.
85 * @param \Drupal\bootstrap\Theme $theme
86 * The theme that the update is being applied to.
87 * @param array $context
88 * The Batch API context array, passed by reference. Note: be very careful
89 * to not store any instances created from a theme. The Batch API stores
90 * this in the DB between each "request" and it may not be able to fully
91 * reconstitute the object upon un-serialization. If you need to pass a
92 * theme object between instances, you should instead use an identifier
93 * (string) that can be used to reconstitute the object when needed.
96 * FALSE if the update failed, otherwise any other return will be
97 * interpreted as TRUE.
99 public function process(Theme $theme, array &$context);