‪TYPO3CMS  ‪main
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  protected string ‪$defaultViewObjectName = JsonView::class;
34 
35  public function ‪__construct(
39  ) {
40  parent::__construct(‪$dataMapFactory, ‪$queueService);
41  $this->contentRepository = ‪$contentRepository;
42  }
43 
44  public function ‪listAction()
45  {
46  $contents = $this->contentRepository->findAll();
47  $value = $this->‪getStructure($contents);
48  return $this->‪process($value);
49  }
50 
51  public function ‪showAction(‪Content $content)
52  {
53  $value = $this->‪getStructure($content);
54  return $this->‪process($value);
55  }
56 
60  public function ‪newAction(‪Content $newContent = null): void
61  {
62  $this->view->assign('newContent', $newContent);
63  }
64 
65  public function ‪createAction(‪Content $newContent): void
66  {
67  $this->contentRepository->add($newContent);
68  $this->‪redirect('list');
69  }
70 
74  public function ‪editAction(‪Content $content): void
75  {
76  $this->view->assign('content', $content);
77  }
78 
79  public function ‪updateAction(‪Content $content): void
80  {
81  $this->contentRepository->update($content);
82  $this->‪redirect('list');
83  }
84 
85  public function ‪deleteAction(‪Content $content): void
86  {
87  $this->contentRepository->remove($content);
88  $this->‪redirect('list');
89  }
90 }
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\__construct
‪__construct(DataMapFactory $dataMapFactory, QueueService $queueService, ContentRepository $contentRepository)
Definition: ContentController.php:35
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:18
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\$contentRepository
‪ContentRepository $contentRepository
Definition: ContentController.php:32
‪TYPO3Tests\TestIrreForeignfield\Controller
Definition: AbstractController.php:18
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\listAction
‪listAction()
Definition: ContentController.php:44
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\newAction
‪newAction(Content $newContent=null)
Definition: ContentController.php:60
‪TYPO3Tests\TestIrreForeignfield\Service\QueueService
Definition: QueueService.php:26
‪TYPO3Tests\TestIrreForeignfield\Domain\Model\Content
Definition: Content.php:27
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\$defaultViewObjectName
‪string $defaultViewObjectName
Definition: ContentController.php:33
‪TYPO3Tests\TestIrreForeignfield\Domain\Repository\ContentRepository
Definition: ContentRepository.php:27
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\createAction
‪createAction(Content $newContent)
Definition: ContentController.php:65
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
Definition: DataMapFactory.php:34
‪TYPO3Tests\TestIrreForeignfield\Controller\AbstractController
Definition: AbstractController.php:34
‪TYPO3Tests\TestIrreForeignfield\Controller\AbstractController\getStructure
‪getStructure($iterator)
Definition: AbstractController.php:64
‪TYPO3Tests\TestIrreForeignfield\Controller\AbstractController\$dataMapFactory
‪DataMapFactory $dataMapFactory
Definition: AbstractController.php:35
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\editAction
‪editAction(Content $content)
Definition: ContentController.php:74
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\deleteAction
‪deleteAction(Content $content)
Definition: ContentController.php:85
‪TYPO3Tests\TestIrreForeignfield\Controller\AbstractController\$queueService
‪QueueService $queueService
Definition: AbstractController.php:36
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController\redirect
‪redirect(?string $actionName, ?string $controllerName=null, ?string $extensionName=null, ?array $arguments=null, ?int $pageUid=null, $_=null, int $statusCode=303)
Definition: ActionController.php:684
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\showAction
‪showAction(Content $content)
Definition: ContentController.php:51
‪TYPO3Tests\TestIrreForeignfield\Controller\AbstractController\process
‪process($value)
Definition: AbstractController.php:99
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController\updateAction
‪updateAction(Content $content)
Definition: ContentController.php:79
‪TYPO3\CMS\Extbase\Mvc\View\JsonView
Definition: JsonView.php:29
‪TYPO3Tests\TestIrreForeignfield\Controller\ContentController
Definition: ContentController.php:31