Skip to content

Commit

Permalink
Revert "[TASK] Add Category model and repository"
Browse files Browse the repository at this point in the history
This reverts commit 544f5b0.
  • Loading branch information
Tim Nhan Ta authored and Tim Nhan Ta committed Jan 16, 2018
1 parent f7bf10f commit 2e823b9
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 90 deletions.
2 changes: 1 addition & 1 deletion Classes/Controller/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ItemController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
/**
* categoryRepository
*
* @var \Pixelant\PxaItemList\Domain\Repository\CategoryRepository
* @var \TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository
* @inject
*/
protected $categoryRepository = null;
Expand Down
41 changes: 0 additions & 41 deletions Classes/Domain/Model/Category.php

This file was deleted.

18 changes: 13 additions & 5 deletions Classes/Domain/Model/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Item extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
/**
* Categories
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Pixelant\PxaItemList\Domain\Model\Category>
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
*/
protected $categories = null;

Expand Down Expand Up @@ -348,7 +348,7 @@ public function setPdf(\TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf)
/**
* Adds a Category
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Pixelant\PxaItemList\Domain\Model\Category> $category
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $category
* @return void
*/
public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
Expand All @@ -359,7 +359,7 @@ public function addCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $category)
/**
* Removes a Category
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Pixelant\PxaItemList\Domain\Model\Category> $categoryToRemove
* @param \TYPO3\CMS\Extbase\Domain\Model\Category $categoryToRemove The Category to be removed
* @return void
*/
public function removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $categoryToRemove)
Expand All @@ -375,6 +375,10 @@ public function removeCategory(\TYPO3\CMS\Extbase\Domain\Model\Category $categor
public function getCategoriesUidList()
{
$cateroiesUids = [];

/**
* @var Category $category
*/
foreach ($this->getCategories() as $category) {
$cateroiesUids[] = $category->getUid();
}
Expand All @@ -390,6 +394,10 @@ public function getCategoriesUidList()
public function getCategoriesTitleList()
{
$cateroiesTitles = [];

/**
* @var Category $category
*/
foreach ($this->getCategories() as $category) {
$cateroiesTitles[] = $category->getTitle();
}
Expand All @@ -400,7 +408,7 @@ public function getCategoriesTitleList()
/**
* Returns the categories
*
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Pixelant\PxaItemList\Domain\Model\Category> $categories
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories
*/
public function getCategories()
{
Expand All @@ -410,7 +418,7 @@ public function getCategories()
/**
* Sets the categories
*
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Pixelant\PxaItemList\Domain\Model\Category> $categories
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category> $categories
* @return void
*/
public function setCategories(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $categories)
Expand Down
29 changes: 0 additions & 29 deletions Classes/Domain/Repository/CategoryRepository.php

This file was deleted.

3 changes: 1 addition & 2 deletions Configuration/TCA/tx_pxaitemlist_domain_model_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
'1' => array(
'showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, name,'.
' year, customer, product_choice, architect, consultant, installer, description, image,'.
' pdf, date, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime,'.
' --div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category, categories'
' pdf, date, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'
),
),
'palettes' => array(
Expand Down
12 changes: 1 addition & 11 deletions Configuration/TypoScript/setup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,7 @@ plugin.tx_pxaitemlist_item {
translateJsLabels {
1 = label.none
}
}

# map back your model to extbase category table
persistence.classes {
Pixelant\PxaItemList\Domain\Model\Category {
mapping {
recordType = 0
tableName = sys_category
}
}
}
}
}

# Include css
Expand Down
Binary file added Resources/Private/Language/.DS_Store
Binary file not shown.
Binary file added Resources/Private/Partials/.DS_Store
Binary file not shown.
Binary file added Resources/Private/Templates/.DS_Store
Binary file not shown.
Binary file added Resources/Public/Icons/.DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CREATE TABLE tx_pxaitemlist_domain_model_item (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,

categories int(11) unsigned DEFAULT '0' NOT NULL,
name varchar(255) DEFAULT '' NOT NULL,
year int(11) unsigned DEFAULT '0' NOT NULL,
customer varchar(255) DEFAULT '' NOT NULL,
Expand Down Expand Up @@ -47,3 +46,10 @@ CREATE TABLE tx_pxaitemlist_domain_model_item (
KEY language (l10n_parent,sys_language_uid)

);

#
# Table structure for table 'tx_pxaitemlist_domain_model_item'
#
CREATE TABLE tx_pxaitemlist_domain_model_item (
categories int(11) unsigned DEFAULT '0' NOT NULL,
);

0 comments on commit 2e823b9

Please sign in to comment.