‪TYPO3CMS  11.5
ContentController.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 
26 
31 {
33 
37  protected ‪$defaultViewObjectName = JsonView::class;
38 
39  public function ‪__construct(
43  ) {
44  parent::__construct(‪$dataMapFactory, ‪$queueService);
45  $this->contentRepository = ‪$contentRepository;
46  }
47 
48  public function ‪listAction()
49  {
50  $contents = $this->contentRepository->findAll();
51  $value = $this->‪getStructure($contents);
52  return $this->‪process($value);
53  }
54 
58  public function ‪showAction(‪Content $content)
59  {
60  $value = $this->‪getStructure($content);
61  return $this->‪process($value);
62  }
63 
68  public function ‪newAction(?Content $newContent = null): void
69  {
70  $this->view->assign('newContent', $newContent);
71  }
72 
76  public function ‪createAction(Content $newContent): void
77  {
78  $this->contentRepository->add($newContent);
79  $this->‪redirect('list');
80  }
81 
86  public function ‪editAction(Content $content): void
87  {
88  $this->view->assign('content', $content);
89  }
90 
94  public function ‪updateAction(Content $content): void
95  {
96  $this->contentRepository->update($content);
97  $this->‪redirect('list');
98  }
99 
103  public function ‪deleteAction(Content $content): void
104  {
105  $this->contentRepository->remove($content);
106  $this->‪redirect('list');
107  }
108 }
‪TYPO3\TestIrreForeignfield\Controller\ContentController\listAction
‪listAction()
Definition: ContentController.php:47
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:18
‪TYPO3\TestIrreForeignfield\Controller\ContentController\showAction
‪showAction(Content $content)
Definition: ContentController.php:57
‪TYPO3\TestIrreForeignfield\Domain\Model\Content
Definition: Content.php:27
‪TYPO3\TestIrreForeignfield\Domain\Repository\ContentRepository
Definition: ContentRepository.php:27
‪TYPO3\TestIrreForeignfield\Controller\ContentController\deleteAction
‪deleteAction(Content $content)
Definition: ContentController.php:102
‪TYPO3\TestIrreForeignfield\Controller\ContentController\$defaultViewObjectName
‪string $defaultViewObjectName
Definition: ContentController.php:36
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
Definition: DataMapFactory.php:39
‪TYPO3\TestIrreForeignfield\Controller\ContentController\updateAction
‪updateAction(Content $content)
Definition: ContentController.php:93
‪TYPO3\TestIrreForeignfield\Controller\AbstractController\$queueService
‪QueueService $queueService
Definition: AbstractController.php:36
‪TYPO3\TestIrreForeignfield\Controller\AbstractController
Definition: AbstractController.php:34
‪TYPO3\TestIrreForeignfield\Controller\AbstractController\getStructure
‪array getStructure($iterator)
Definition: AbstractController.php:67
‪TYPO3\TestIrreForeignfield\Controller\ContentController\editAction
‪editAction(Content $content)
Definition: ContentController.php:85
‪TYPO3\TestIrreForeignfield\Service\QueueService
Definition: QueueService.php:26
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\redirect
‪never redirect($actionName, $controllerName=null, $extensionName=null, ?array $arguments=null, $pageUid=null, $_=null, $statusCode=303)
Definition: ActionController.php:940
‪TYPO3\TestIrreForeignfield\Controller\ContentController\createAction
‪createAction(Content $newContent)
Definition: ContentController.php:75
‪TYPO3\TestIrreForeignfield\Controller\ContentController
Definition: ContentController.php:31
‪TYPO3\TestIrreForeignfield\Controller\ContentController\$contentRepository
‪ContentRepository $contentRepository
Definition: ContentController.php:32
‪TYPO3\CMS\Extbase\Mvc\View\JsonView
Definition: JsonView.php:31
‪TYPO3\TestIrreForeignfield\Controller\AbstractController\process
‪process($value)
Definition: AbstractController.php:102
‪TYPO3\TestIrreForeignfield\Controller\AbstractController\$dataMapFactory
‪DataMapFactory $dataMapFactory
Definition: AbstractController.php:35
‪TYPO3\TestIrreForeignfield\Controller\ContentController\newAction
‪newAction(?Content $newContent=null)
Definition: ContentController.php:67
‪TYPO3\TestIrreForeignfield\Controller\ContentController\__construct
‪__construct(DataMapFactory $dataMapFactory, QueueService $queueService, ContentRepository $contentRepository)
Definition: ContentController.php:38
‪TYPO3\TestIrreForeignfield\Controller
Definition: AbstractController.php:18