‪TYPO3CMS  9.5
GridRow.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
30 class ‪GridRow extends ‪Section implements ‪GridRowInterface
31 {
32 
39  public function ‪addElement(‪FormElementInterface $formElement)
40  {
41  if ($formElement instanceof ‪GridContainerInterface) {
43  sprintf('Grid containers ("%s") within grid rows ("%s") are not allowed.', $formElement->‪getIdentifier(), $this->getIdentifier()),
44  1489413379
45  );
46  }
47 
48  $this->‪addRenderable($formElement);
49  }
50 
59  public function ‪createElement(string ‪$identifier, string $typeName): ‪FormElementInterface
60  {
61  $element = parent::createElement(‪$identifier, $typeName);
62 
63  if ($element instanceof ‪GridContainerInterface) {
65  sprintf('Grid containers ("%s") within grid rows ("%s") are not allowed.', $element->getIdentifier(), $this->getIdentifier()),
66  1489413538
67  );
68  }
69 
70  return $element;
71  }
72 }
‪TYPO3\CMS\Form\Domain\Model\FormElements\Section
Definition: Section.php:35
‪TYPO3\CMS\Form\Domain\Model\FormElements\GridRow\addElement
‪addElement(FormElementInterface $formElement)
Definition: GridRow.php:39
‪TYPO3\CMS\Form\Domain\Model\FormElements\GridRow
Definition: GridRow.php:31
‪TYPO3\CMS\Form\Domain\Model\Renderable\RootRenderableInterface\getIdentifier
‪string getIdentifier()
‪TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface
Definition: FormElementInterface.php:36
‪TYPO3\CMS\Form\Domain\Model\FormElements\GridContainerInterface
Definition: GridContainerInterface.php:22
‪TYPO3\CMS\Form\Domain\Model\FormElements\GridRowInterface
Definition: GridRowInterface.php:22
‪TYPO3\CMS\Form\Domain\Exception\TypeDefinitionNotValidException
Definition: TypeDefinitionNotValidException.php:27
‪TYPO3\CMS\Form\Domain\Model\Renderable\AbstractRenderable\$identifier
‪string $identifier
Definition: AbstractRenderable.php:52
‪TYPO3\CMS\Form\Domain\Model\Renderable\AbstractCompositeRenderable\addRenderable
‪addRenderable(RenderableInterface $renderable)
Definition: AbstractCompositeRenderable.php:48
‪TYPO3\CMS\Form\Domain\Model\FormElements\GridRow\createElement
‪GridRowInterface createElement(string $identifier, string $typeName)
Definition: GridRow.php:59
‪TYPO3\CMS\Form\Domain\Model\FormElements
Definition: AbstractFormElement.php:3