[TYPO3-english] Getting categories from hook class
Philipp Dieter
dieterph at posteo.de
Wed Oct 26 17:10:43 CEST 2016
Hi there,
im writing an extension in which I need to get the details of a
category from a function which is called as a hook.
A bit of reading and a bit of testing I came to this solution:
/** @var $objectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
$objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
/** @var $orderRepository \GeorgRinger\News\Domain\Repository\CategoryRepository */
$categoryRepository = $objectManager->get('TYPO3\\CMS\\Extbase\\Domain\\Repository\\CategoryRepository');
$category = $categoryRepository->findOneByTitle('categoryname');
But i get this message:
#1247602160: Table 'typo3.tx_extbase_domain_model_category' doesn't exist
I am wondering how this name of this table is defined. I thought it
would have to be 'sys_category'.
Can anyone explain this to me or help me to debug this?
Greetings
Philipp
More information about the TYPO3-english
mailing list