component = $component; $this->contexts = $contexts; $this->plugin = $component->getPlugin($contexts); $this->inPreview = $in_preview; } /** * Get the section component whose render array is being built. * * @return \Drupal\layout_builder\SectionComponent * The section component whose render array is being built. */ public function getComponent() { return $this->component; } /** * Get the available contexts. * * @return array|\Drupal\Core\Plugin\Context\ContextInterface[] * The available contexts. */ public function getContexts() { return $this->contexts; } /** * Get the plugin for the section component being built. * * @return \Drupal\Component\Plugin\PluginInspectionInterface * The plugin for the section component being built. */ public function getPlugin() { return $this->plugin; } /** * Determine if the component is in preview mode. * * @return bool * Whether the component is in preview mode or not. */ public function inPreview() { return $this->inPreview; } /** * Get the render array in its current state. * * @return array * The render array built by the event subscribers. */ public function getBuild() { return $this->build; } /** * Set the render array. * * @param array $build * A render array. */ public function setBuild(array $build) { $this->build = $build; } }