Commit 4cd6e8e9 authored by Dirk Wildt's avatar Dirk Wildt

0.0.6

parent 3440f71d
......@@ -436,12 +436,6 @@ class CellController extends AbstractController
$this->_setGroupForCell( $cell, $group );
$this->cellRepository->update( $cell );
}
// var_dump(__METHOD__, __LINE__, $group, empty($group));
// die();
// $title = $group->getTitle();
// $prompt = 'Group "' . $title . '" is removed.';
// $this->addFlashMessage( $prompt, '', \TYPO3\CMS\Core\Messaging\AbstractMessage::NOTICE );
// $this->groupRepository->remove( $group );
}
return;
}
......@@ -468,20 +462,7 @@ class CellController extends AbstractController
// Do nothing
return;
case( $this->_ticketIsNull() ):
$groups = array_unique( $groups );
foreach( $groups as $group )
{
if( empty( $group ) )
{
continue;
}
// var_dump(__METHOD__, __LINE__, $group, empty($group));
// die();
// $title = $group->getTitle();
// $prompt = 'Group "' . $title . '" is removed.';
// $this->addFlashMessage( $prompt, '', \TYPO3\CMS\Core\Messaging\AbstractMessage::NOTICE );
$this->groupRepository->remove( $group );
}
$this->groupRepository->removeGroups( $groups );
return;
}
}
......
......@@ -158,16 +158,17 @@ class ModuleController extends AbstractController
*/
public function deleteAction( \Netzmacher\Tile\Domain\Model\Area $area )
{
$groups = [];
$cells = $this->cellRepository->findBytx_tile_area( $area->getUid() );
foreach( $cells as $cell )
{
$groups[] = $cell->getTxTileGroup();
$area->removeTxTileCell( $cell );
$this->cellRepository->remove( $cell );
}
$this->areaRepository->remove( $area );
$header = ':TODO:';
$prompt = 'Remove deprecated groups! @ ' . __METHOD__ . ' (#' . __LINE__ . ')';
$this->addFlashMessage( $prompt, $header, \TYPO3\CMS\Core\Messaging\AbstractMessage::NOTICE );
$this->groupRepository->removeGroups( $groups );
$this->redirect( 'list' );
}
......
<?php
namespace Netzmacher\Tile\Domain\Repository;
namespace Netzmacher\Tile\Domain\Repository;
/***
/* * *
*
* This file is part of the "Book a tile!" Extension for TYPO3 CMS.
*
......@@ -11,10 +11,35 @@ namespace Netzmacher\Tile\Domain\Repository;
*
* (c) 2019 Dirk Wildt (Die Netzmacher) <http://wildt@die-netzmacher.de>, Die Netzmacher
*
***/
* * */
/**
* The repository for Groups
*/
class GroupRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
/**
* removeGroups()
*
* @param array $groups
* @return void
* @version 0.0.6
* @since 0.0.6
* @internal #t3816
*/
public function removeGroups( array $groups )
{
$groups = array_unique( $groups );
foreach( $groups as $group )
{
if( empty( $group ) )
{
continue;
}
$this->remove( $group );
}
return;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment