‪TYPO3CMS  ‪main
CustomFileControlsEvent.php
Go to the documentation of this file.
1 <?php
2 
3 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 
24 {
25  private array ‪$controls = [];
26 
27  public function ‪__construct(
28  private array $resultArray,
29  private readonly string $tableName,
30  private readonly string $fieldName,
31  private readonly array $databaseRow,
32  private readonly array $fieldConfig,
33  private readonly string $formFieldIdentifier,
34  private readonly string $formFieldName,
35  ) {}
36 
37  public function ‪getResultArray(): array
38  {
39  return $this->resultArray;
40  }
41 
46  public function ‪setResultArray(array $resultArray): void
47  {
48  $this->resultArray = $resultArray;
49  }
50 
51  public function ‪getControls(): array
52  {
53  return ‪$this->controls;
54  }
55 
56  public function ‪setControls(array ‪$controls): void
57  {
58  $this->controls = ‪$controls;
59  }
60 
61  public function ‪addControl(string $control, string ‪$identifier = ''): void
62  {
63  if (‪$identifier !== '') {
64  $this->controls[‪$identifier] = $control;
65  } else {
66  $this->controls[] = $control;
67  }
68  }
69 
70  public function ‪removeControl(string ‪$identifier): bool
71  {
72  if (!isset($this->controls[‪$identifier])) {
73  return false;
74  }
75  unset($this->controls[‪$identifier]);
76  return true;
77  }
78 
79  public function ‪getTableName(): string
80  {
81  return $this->tableName;
82  }
83 
84  public function ‪getFieldName(): string
85  {
86  return $this->fieldName;
87  }
88 
89  public function ‪getDatabaseRow(): array
90  {
91  return $this->databaseRow;
92  }
93 
94  public function ‪getFieldConfig(): array
95  {
96  return $this->fieldConfig;
97  }
98 
99  public function ‪getFormFieldIdentifier(): string
100  {
101  return $this->formFieldIdentifier;
102  }
103 
104  public function ‪getFormFieldName(): string
105  {
106  return $this->formFieldName;
107  }
108 }
‪TYPO3\CMS\Backend\Form\Event
Definition: CustomFileControlsEvent.php:18
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\__construct
‪__construct(private array $resultArray, private readonly string $tableName, private readonly string $fieldName, private readonly array $databaseRow, private readonly array $fieldConfig, private readonly string $formFieldIdentifier, private readonly string $formFieldName,)
Definition: CustomFileControlsEvent.php:27
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\$controls
‪array $controls
Definition: CustomFileControlsEvent.php:25
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getResultArray
‪getResultArray()
Definition: CustomFileControlsEvent.php:37
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getFormFieldIdentifier
‪getFormFieldIdentifier()
Definition: CustomFileControlsEvent.php:99
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getFieldConfig
‪getFieldConfig()
Definition: CustomFileControlsEvent.php:94
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\addControl
‪addControl(string $control, string $identifier='')
Definition: CustomFileControlsEvent.php:61
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\setControls
‪setControls(array $controls)
Definition: CustomFileControlsEvent.php:56
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\removeControl
‪removeControl(string $identifier)
Definition: CustomFileControlsEvent.php:70
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getFormFieldName
‪getFormFieldName()
Definition: CustomFileControlsEvent.php:104
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent
Definition: CustomFileControlsEvent.php:24
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getDatabaseRow
‪getDatabaseRow()
Definition: CustomFileControlsEvent.php:89
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getTableName
‪getTableName()
Definition: CustomFileControlsEvent.php:79
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\setResultArray
‪setResultArray(array $resultArray)
Definition: CustomFileControlsEvent.php:46
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getFieldName
‪getFieldName()
Definition: CustomFileControlsEvent.php:84
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37
‪TYPO3\CMS\Backend\Form\Event\CustomFileControlsEvent\getControls
‪getControls()
Definition: CustomFileControlsEvent.php:51