@param int $arLayoutPresetID

@return static
192562
public static function getByID($arLayoutPresetID)
    {
        $db = Loader::db();
        $row = $db->GetRow(
            'select arLayoutID, arLayoutPresetID, arLayoutPresetName from AreaLayoutPresets where arLayoutPresetID = ?',
            array(
                $arLayoutPresetID,
            )
        );
        if (is_array($row) && $row['arLayoutPresetID']) {
            $preset = new static();
            $preset->setPropertiesFromArray($row);

            return $preset;
        }
    }
160656
View createPresetsView() {
    View contentView = View.inflate(getActivity(), R.layout.cpv_dialog_presets, null);
    shadesLayout = (LinearLayout) contentView.findViewById(R.id.shades_layout);
    transparencySeekBar = (SeekBar) contentView.findViewById(R.id.transparency_seekbar);
    transparencyPercText = (TextView) contentView.findViewById(R.id.transparency_text);
    GridView gridView = (GridView) contentView.findViewById(R.id.gridView);

    loadPresets();

    if (showColorShades) {
      createColorShades(color);
    } else {
      shadesLayout.setVisibility(View.GONE);
      contentView.findViewById(R.id.shades_divider).setVisibility(View.GONE);
    }

    adapter = new ColorPaletteAdapter(new ColorPaletteAdapter.OnColorSelectedListener() {
      @Override public void onColorSelected(int newColor) {
        if (color == newColor) {
          // Double tab selects the color
          ColorPickerDialog.this.onColorSelected(color);
          dismiss();
          return;
        }
        color = newColor;
        if (showColorShades) {
          createColorShades(color);
        }
      }
    }, presets, getSelectedItemPosition(), colorShape);

    gridView.setAdapter(adapter);

    if (showAlphaSlider) {
      setupTransparency();
    } else {
      contentView.findViewById(R.id.transparency_layout).setVisibility(View.GONE);
      contentView.findViewById(R.id.transparency_title).setVisibility(View.GONE);
    }

    return contentView;
  }
1094146
protected function createLayoutTranslation(LayoutInterface $layout, array $config)
    {
        $translation = $this->newLayoutTranslationInstance($layout);
        $translation->setLocale(ConfigUtil::getValue($config, 'locale'));
        $translation->setLabel(ConfigUtil::getValue($config, 'label'));
        $translation->setDescription(ConfigUtil::getValue($config, 'description'));
        $translation->setBody(ConfigUtil::getValue($config, 'body'));

        return $translation;
    }
1336302
protected function prepareLayoutView(
        ModelInterface $layoutView,
        Site $site,
        Page $page
    ) {
        $layoutOverRide = $page->getSiteLayoutOverride();

        if (!empty($layoutOverRide)) {
            $layoutTemplatePath = $this->getLayoutManager()->getSiteLayout(
                $site,
                $layoutOverRide
            );

            $layoutView->setTemplate('layout/' . $layoutTemplatePath);
        }

        return $layoutView;
    }
183609
public function onLoadLayout(ITemplateFactory $templateFactory, $layoutFile, $presenterName)
	{
		if (!$this->activeTheme) {
			return;
		}

		$templateFactory->addLayout(
			$this->formatTemplateFilePath($this->activeTheme, $layoutFile, $presenterName)
		);
		$templateFactory->addLayout(
			$this->formatTemplateFilePath($this->activeTheme, $layoutFile)
		);

		$parent = $this->activeTheme->getParent();
		if (!$parent) {
			return;
		}
		$parentTheme = $this->getTheme($parent);
		$templateFactory->addLayout(
			$this->formatTemplateFilePath($parentTheme, $layoutFile, $presenterName)
		);
		$templateFactory->addLayout(
			$this->formatTemplateFilePath($parentTheme, $layoutFile)
		);
	}
276285
private function initLayoutUpdates(ContextInterface $context)
    {
        $loadedLayoutUpdates = $this->loadLayoutUpdates($context);
        foreach ($loadedLayoutUpdates as $id => $layoutUpdates) {
            if (!is_string($id)) {
                throw new Exception\UnexpectedTypeException(
                    $id,
                    'string',
                    'layout item id'
                );
            }
            if (!is_array($layoutUpdates)) {
                throw new Exception\UnexpectedTypeException(
                    $layoutUpdates,
                    'array',
                    sprintf('layout updates for item "%s"', $id)
                );
            }
            foreach ($layoutUpdates as $layoutUpdate) {
                if (!$layoutUpdate instanceof LayoutUpdateInterface) {
                    throw new Exception\UnexpectedTypeException(
                        $layoutUpdate,
                        'Oro\Component\Layout\LayoutUpdateInterface'
                    );
                }
            }
        }
        $this->layoutUpdates = $loadedLayoutUpdates;
    }
1075575
public function prependAdapter(AdapterInterface $adapter)
    {
        $priority = self::DEFAULT_PRIORITY;

        if (!$this->adapters->isEmpty()) {
            $extractedNodes = $this->adapters->toArray(PriorityQueue::EXTR_PRIORITY);

            rsort($extractedNodes, SORT_NUMERIC);

            $priority = $extractedNodes[0] + 1;
        }

        $this->adapters->insert($adapter, $priority);

        return $this;
    }
1130677
public function getLayoutColumnsSelectItems($layoutId)
    {
        $setup = $this->getLayoutSetup($layoutId);
        if (empty($setup['config']['rows.'])) {
            return [];
        }

        $selectItems = [];
        foreach ($setup['config']['rows.'] as $row) {
            if (empty($row['columns.'])) {
                continue;
            }
            foreach ($row['columns.'] as $column) {
                $selectItems[] = [
                    $this->languageService->sL($column['name']),
                    $column['colPos'],
                    null,
                    $column['allowed'] ? $column['allowed'] : '*',
                ];
            }
        }

        return $selectItems;
    }
1230319
public function discard($layoutId)
    {
        $this->getLogger()->info('Discarding draft of layout ID ' . $layoutId);
        $response = $this->doPut('/layout/discard/' . $layoutId);

        $layout = $this->constructLayoutFromResponse($response);

        $this->getLogger()->debug('LayoutId is now: ' . $layout->layoutId);

        return $layout;
    }
465640
private function getPrepareFieldLayout(array $fieldLayoutDef): array
    {
        $layoutFields = [];
        $requiredFields = [];

        foreach ($fieldLayoutDef as $fieldHandle => $required) {
            $field = Craft::$app->fields->getFieldByHandle($fieldHandle);
            if ($field instanceof Field) {
                $layoutFields[] = $field->id;

                if ($required) {
                    $requiredFields[] = $field->id;
                }
            }
        }

        return [
          'fields' => $layoutFields,
          'required' => $requiredFields,
        ];
    }
11695
private function GrantCreateLayout()
    {
        $groups = $this->GetGroups();
        foreach ($groups as $group)
        {
            if ($group->GetCreateLayouts())
            {
                return GrantResult::Allowed();
            }
        }
        return GrantResult::NoAccess();
    }
900268
static function LayoutTemplate(Layout $layout)
    {
        $folder = Path::Combine(PHINE_PATH, 'App/Phine/LayoutTemplates');
        $file = Path::Combine($folder, $layout->GetName());
        return Path::AddExtension($file, 'phtml');
    }
921081
public function getLayout(): ?Layout
    {
        $layoutView = $this->getLayoutView();
        if (!$layoutView instanceof LayoutViewInterface) {
            return null;
        }

        return $layoutView->getLayout();
    }
9034
public function getPageLayoutByValue($pageLayout)
    {

        // query whether or not, the requested display mode is available
        if (isset($this->availablePageLayouts[$pageLayout])) {
            return $this->availablePageLayouts[$pageLayout];
        }

        // throw an exception, if not
        throw new \Exception(printf('Found invalid page layout %s', $pageLayout));
    }
139609
public function preProcess(PageLayoutView &$parentObject, &$info, array &$row)
    {
        if ($this->skipRendering($parentObject, $row)) {
            return;
        }

        $renderer = GeneralUtility::makeInstance(ColumnRenderer::class, $row);

        if (!$renderer->skipRendering()) {
            list($html, $css) = $renderer->renderSingleColumn();

            $info[] = $html;
            $this->inlineStyles[] = $css;
        }

        return;
    }
992455
public function toBePresent()
    {
        $this->wait()->until(WebDriverExpectedCondition::presenceOfElementLocated($this->elementFinder->getSearchCriteria()));

        return $this;
    }
473643
protected function _initLayout($layout)
    {
        list($theme, ) = namespaceSplit(get_class($this));
        $layoutClass = $theme . '\\View\\Layout\\' . $layout . 'Layout';

        try {
            /** @var Layout $layout */
            $layout = new $layoutClass();
        } catch (Exception $e) {
            throw new Exception(__d('wasabi_cms', 'The layout "{0}" could not be instatiated. Check the namespace and file location.', $layoutClass));
        }

        $this->_layouts[$layout->id()] = $layout;
    }