Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Drupal\display_builder;
6
7/**
8 * Provides an interface defining a display builder instance entity type.
9 */
10interface PublishableInterface {
11
12  /**
13   * Check display has required context, meaning it can save value.
14   *
15   * @return bool
16   *   True if required, False otherwise.
17   */
18  public function isPublishable(): bool;
19
20  /**
21   * Check display has required context, meaning it can save value.
22   *
23   * @param string $key
24   *   The context key to look for.
25   * @param \Drupal\Core\Plugin\Context\ContextInterface[] $contexts
26   *   (Optional) contexts if already accessible, keyed by context name.
27   *
28   * @return bool
29   *   True if required, False otherwise.
30   */
31  public function hasSaveContextsRequirement(string $key, array $contexts = []): bool;
32
33  /**
34   * If display builder has been saved.
35   *
36   * @return bool
37   *   Has save data.
38   */
39  public function isPublished(): bool;
40
41  /**
42   * The save value is the current value of display builder.
43   *
44   * @return bool
45   *   The save is the current or not.
46   */
47  public function isPublishedPresent(): bool;
48
49  /**
50   * Restore to the last saved state.
51   */
52  public function restore(): void;
53
54}