Problem/Motivation

  /**
   * Gets the runtime sections for a given entity.
   *
   * @param \Drupal\Core\Entity\FieldableEntityInterface $entity
   *   The entity.
   *
   * @return \Drupal\layout_builder\Section[]
   *   The sections.
   */
  protected function getRuntimeSections(FieldableEntityInterface $entity) {
    if ($this->isOverridable() && !$entity->get('layout_builder__layout')->isEmpty()) {
      return $entity->get('layout_builder__layout')->getSections();
    }

    return $this->getSections();
  }

The term "runtime" is not helpful here, as it seems to be referring to a special concept that doesn't exist.

Proposed resolution

  • Improve the docblock
  • Consider renaming to getEntitySections()
  • Consider deprecating in favor of \Drupal\layout_builder\LayoutEntityHelperTrait::getEntitySections()

Remaining tasks

Decide the scope

User interface changes

N/A

API changes

Only protected methods changing

Data model changes

N/A

Comments

tim.plunkett created an issue. See original summary.

xjm credited phenaproxima.

xjm’s picture

@phenaproxima and I originally raised this question.

xjm’s picture

Issue summary: View changes
tim.plunkett’s picture