NcTestobjController.php 3.37 KB
<?php
namespace Netzcoop\Anctestextension\Controller;

/***
 *
 * This file is part of the "anc test extension" Extension for TYPO3 CMS.
 *
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
 *
 *  (c) 2017
 *
 ***/

/**
 * NcTestobjController
 */
class NcTestobjController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
{
    /**
     * ncTestobjRepository
     *
     * @var \Netzcoop\Anctestextension\Domain\Repository\NcTestobjRepository
     * @inject
     */
    protected $ncTestobjRepository = null;

    /**
     * action list
     *
     * @return void
     */
    public function listAction()
    {
        $ncTestobjs = $this->ncTestobjRepository->findAll();
        $this->view->assign('ncTestobjs', $ncTestobjs);
    }

    /**
     * action show
     *
     * @param \Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj
     * @return void
     */
    public function showAction(\Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj)
    {
        $this->view->assign('ncTestobj', $ncTestobj);
    }

    /**
     * action new
     *
     * @return void
     */
    public function newAction()
    {

    }

    /**
     * action create
     *
     * @param \Netzcoop\Anctestextension\Domain\Model\NcTestobj $newNcTestobj
     * @return void
     */
    public function createAction(\Netzcoop\Anctestextension\Domain\Model\NcTestobj $newNcTestobj)
    {
        $this->addFlashMessage('The object was created. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
        $this->ncTestobjRepository->add($newNcTestobj);
        $this->redirect('list');
    }

    /**
     * action edit
     *
     * @param \Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj
     * @ignorevalidation $ncTestobj
     * @return void
     */
    public function editAction(\Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj)
    {
        $this->view->assign('ncTestobj', $ncTestobj);
    }

    /**
     * action update
     *
     * @param \Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj
     * @return void
     */
    public function updateAction(\Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj)
    {
        $this->addFlashMessage('The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
        $this->ncTestobjRepository->update($ncTestobj);
        $this->redirect('list');
    }

    /**
     * action delete
     *
     * @param \Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj
     * @return void
     */
    public function deleteAction(\Netzcoop\Anctestextension\Domain\Model\NcTestobj $ncTestobj)
    {
        $this->addFlashMessage('The object was deleted. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html', '', \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING);
        $this->ncTestobjRepository->remove($ncTestobj);
        $this->redirect('list');
    }
}