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