summaryrefslogtreecommitdiffstats
path: root/core/modules/breakpoint/src/BreakpointGroupInterface.php
blob: ae4f2e94a12b5ef9cf2ac7ab3a48fe5e65b93146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php

/**
 * @file
 * Contains \Drupal\breakpoint\Entity\BreakpointGroupInterface.
 */

namespace Drupal\breakpoint;

use Drupal\Core\Config\Entity\ConfigEntityInterface;

/**
 * Provides an interface defining a breakpoint group entity.
 */
interface BreakpointGroupInterface extends ConfigEntityInterface {

  /**
   * Checks if the breakpoint group is valid.
   *
   * @throws \Drupal\breakpoint\InvalidBreakpointSourceTypeException
   * @throws \Drupal\breakpoint\InvalidBreakpointSourceException
   *
   * @return bool
   *   Returns TRUE if the breakpoint group is valid.
   */
  public function isValid();

  /**
   * Adds a breakpoint using a name and a media query.
   *
   * @param string $name
   *   The name of the breakpoint.
   * @param string $media_query
   *   Media query.
   */
  public function addBreakpointFromMediaQuery($name, $media_query);

  /**
   * Adds one or more breakpoints to this group.
   *
   * The breakpoint name is either the machine_name or the ID of a breakpoint.
   *
   * @param array $breakpoints
   *   Array containing breakpoint objects
   *
   * @return \Drupal\breakpoint\Entity\BreakpointGroup
   *   The breakpoint group object.
   */
  public function addBreakpoints($breakpoints);

  /**
   * Gets the array of breakpoints for the breakpoint group.
   *
   * @return \Drupal\breakpoint\Entity\BreakpointInterface[]
   *   The array of breakpoints for the breakpoint group.
   */
  public function getBreakpoints();

  /**
   * Gets a breakpoint from the breakpoint group by ID.
   *
   * @param string $id
   *   The breakpoint ID to get.
   *
   * @return \Drupal\breakpoint\Entity\BreakpointInterface|boolean
   *   The breakpoint or FALSE if not in the Breakpoint group.
   */
  public function getBreakpointById($id);

}