TYPO3 CMS  TYPO3_7-6
ContentController.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
26  protected $contentRepository;
27 
31  protected $defaultViewObjectName = \TYPO3\CMS\Extbase\Mvc\View\JsonView::class;
32 
36  public function listAction()
37  {
38  $contents = $this->contentRepository->findAll();
39  $value = $this->getStructure($contents);
40  $this->process($value);
41  }
42 
47  public function showAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
48  {
49  $value = $this->getStructure($content);
50  $this->process($value);
51  }
52 
58  public function newAction(\OliverHader\IrreTutorial\Domain\Model\Content $newContent = null)
59  {
60  $this->view->assign('newContent', $newContent);
61  }
62 
67  public function createAction(\OliverHader\IrreTutorial\Domain\Model\Content $newContent)
68  {
69  $this->contentRepository->add($newContent);
70  $this->redirect('list');
71  }
72 
78  public function editAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
79  {
80  $this->view->assign('content', $content);
81  }
82 
87  public function updateAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
88  {
89  $this->contentRepository->update($content);
90  $this->redirect('list');
91  }
92 
97  public function deleteAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
98  {
99  $this->contentRepository->remove($content);
100  $this->redirect('list');
101  }
102 }
newAction(\OliverHader\IrreTutorial\Domain\Model\Content $newContent=null)
redirect($actionName, $controllerName=null, $extensionName=null, array $arguments=null, $pageUid=null, $delay=0, $statusCode=303)
deleteAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
showAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
createAction(\OliverHader\IrreTutorial\Domain\Model\Content $newContent)
editAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)
updateAction(\OliverHader\IrreTutorial\Domain\Model\Content $content)