I am just trying things out with extbase and ran into a problem using two tables (repostiories) and an mm_table to store the relations.
- address able
- category table
- address_category mm table <- how to add entries in this?
I created an object of type Address and can setName etc. with no problems. But there is also a cateogry table and the two tables are related by an mm_table. And this relation I can only make in the TYPO3 backend but not in the plugin.
Code is like this:
// get repo $addressRepo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\GoMapsExt\Domain\Repository\AddressRepository'); $addressCategoryRepo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\GoMapsExt\Domain\Repository\CategoryRepository'); // get category object (lead = 2)) $addressCategoryObj = $addressCategoryRepo->findByUid(2); // attach category to address //$go_map_address->setCategories($addressCategoryObj); <-- need to add category here
How can I add such a relation? There is no setCategory method it seems.