setIdentifier($identifier); $this->setTitle($title); if (is_array($configuration)) { $this->structure = $configuration; $this->configuration = $configuration['config'] ?? ''; } else { $this->setConfiguration($configuration); } } public function getIdentifier(): string { return $this->identifier; } public function getIdentifierCleaned(): string { return strtolower((string)preg_replace('/[^a-zA-Z0-9_-]/', '', $this->identifier)); } public function setIdentifier(string $identifier): void { if (str_contains($identifier, '__')) { throw new \UnexpectedValueException( 'Identifier "' . $identifier . '" must not contain "__"', 1381597630 ); } $this->identifier = $identifier; } public function getTitle(): string { return $this->title; } public function setTitle(string $title): void { $this->title = $title; } public function getDescription(): string { return $this->description; } public function setDescription(string $description): void { $this->description = $description; } public function getIconPath(): string { return $this->iconPath; } public function setIconPath(string $iconPath): void { $this->iconPath = $iconPath; } public function getConfiguration(): string { return $this->configuration; } public function setConfiguration(string $configuration): void { $this->configuration = $configuration; $this->structure = GeneralUtility::makeInstance(BackendLayoutView::class)->parseStructure($this); } /** * Returns the columns registered for this layout as $key => $value pair where the key is the colPos * and the value is the title. * "1" => "Left" etc. * Please note that the title can contain LLL references ready for translation. */ public function getUsedColumns(): array { return $this->structure['usedColumns'] ?? []; } public function getColCount(): int { return $this->structure['colCount'] ?? 0; } public function getRowCount(): int { return $this->structure['rowCount'] ?? 0; } public function getData(): array { return $this->data; } public function setData(array $data): void { $this->data = $data; } public function setStructure(array $structure): void { $this->structure = $structure; } public function getStructure(): array { return $this->structure; } /** * @return string[] */ public function getColumnPositionNumbers(): array { return $this->structure['__colPosList'] ?? []; } }