[TYPO3-dev] EXTBASE Repository.

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Sat Mar 21 22:15:28 CET 2015


Hi Christian

Waht's the line where you define CategoryRepository? Maybe you inject
the wrong repository class?

Bye
Till

On 03/21/2015 09:43 PM, Christian Tauscher wrote:
> Hello.
>
> I have a DB table printitem.
> A second table category which printitem is categoized.
>
> In Create/Edit Mode I want a select field with category.
>
> fluid.partial:
> ---------------
> <f:form.select property="substrate" options="{categoryOptions}" />
>
>
>
> /**
>  * action edit
>  *
>  * @param \Tmd\screenprinting\Domain\Model\Printitem $printitem
>  * @ignorevalidation $printitem
>  * @return void
>  */
> public function editAction(\Tmd\screenprinting\Domain\Model\Printitem
> $printitem) {
>   $this->view->assign('printitem', $printitem);
>   $allItems = $this->CategoryRepository->findAll();
>
>   foreach($allItems as $item) {
>     $options[$item->getUid()] = $item->getName();
>   }
>   $this->view->assign('categoryOptions', $options);
> }
>
>
> The Problem:
> in $options is not the Expected Array of Category but of Printitem.
>
> ???
>
> What is wrong.
> I have added Class/Controller/Repositpry/CategoryRepository.php whith
> no other result.
>
> <?php
> namespace Tmd\Screenprinting\Domain\Repository;
> /**
>  * The repository for Category
>  */
> class CategoryRepository extends
> \TYPO3\CMS\Extbase\Persistence\Repository {
> }
>
>
> Next try:
> I habe a next table branch. Same as bevor, only different Name.
>
> changin the CategoryRepository zu branch
>   $allItems = $this->branchRepository->findAll();
>
> leads to.
>
> Fatal error: Call to a member function findAll() on a non-object in
> .../screenprinting/Classes/Controller/PrintitemController.php on line 158
>
>
>
> WTF....
>
>
>
>
>
> Thank you for your help,
>
> Christian
>
> PS:
> rm * typo3temp/Cache/*,
> clearing cache in BE does not help.
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev




More information about the TYPO3-dev mailing list