Verified Commit a99e0b57 authored by Dave Long's avatar Dave Long
Browse files

Issue #2985362 by DanielVeza, tim.plunkett, mstrelan, quietone, kim.pepper,...

Issue #2985362 by DanielVeza, tim.plunkett, mstrelan, quietone, kim.pepper, acbramley: Create an interface to share the definition of the overridable methods on DefaultsSectionStorageInterface and LayoutEntityDisplayInterface
parent c9d305c5
Loading
Loading
Loading
Loading
Loading
+1 −23
Original line number Diff line number Diff line
@@ -6,27 +6,5 @@

/**
 * Defines an interface for an object that stores layout sections for defaults.
 *
 * @todo Refactor this interface in https://www.drupal.org/node/2985362.
 */
interface DefaultsSectionStorageInterface extends SectionStorageInterface, ThirdPartySettingsInterface, LayoutBuilderEnabledInterface {

  /**
   * Determines if the defaults allow custom overrides.
   *
   * @return bool
   *   TRUE if custom overrides are allowed, FALSE otherwise.
   */
  public function isOverridable();

  /**
   * Sets the defaults to allow or disallow overrides.
   *
   * @param bool $overridable
   *   TRUE if the display should allow overrides, FALSE otherwise.
   *
   * @return $this
   */
  public function setOverridable($overridable = TRUE);

}
interface DefaultsSectionStorageInterface extends SectionStorageInterface, ThirdPartySettingsInterface, LayoutBuilderEnabledInterface, LayoutBuilderOverridableInterface {}
+2 −23
Original line number Diff line number Diff line
@@ -5,30 +5,9 @@
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\layout_builder\LayoutBuilderEnabledInterface;
use Drupal\layout_builder\SectionListInterface;
use Drupal\layout_builder\LayoutBuilderOverridableInterface;

/**
 * Provides an interface for entity displays that have layout.
 *
 * @todo Refactor this interface in https://www.drupal.org/node/2985362.
 */
interface LayoutEntityDisplayInterface extends EntityDisplayInterface, SectionListInterface, LayoutBuilderEnabledInterface {

  /**
   * Determines if the display allows custom overrides.
   *
   * @return bool
   *   TRUE if custom overrides are allowed, FALSE otherwise.
   */
  public function isOverridable();

  /**
   * Sets the display to allow or disallow overrides.
   *
   * @param bool $overridable
   *   TRUE if the display should allow overrides, FALSE otherwise.
   *
   * @return $this
   */
  public function setOverridable($overridable = TRUE);

}
interface LayoutEntityDisplayInterface extends EntityDisplayInterface, SectionListInterface, LayoutBuilderEnabledInterface, LayoutBuilderOverridableInterface {}
+28 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\layout_builder;

/**
 * Provides an interface for displays that could be overridable.
 */
interface LayoutBuilderOverridableInterface {

  /**
   * Determines if the display allows custom overrides.
   *
   * @return bool
   *   TRUE if custom overrides are allowed, FALSE otherwise.
   */
  public function isOverridable();

  /**
   * Sets the display to allow or disallow overrides.
   *
   * @param bool $overridable
   *   TRUE if the display should allow overrides, FALSE otherwise.
   *
   * @return $this
   */
  public function setOverridable($overridable = TRUE);

}