[TYPO3-dev] Repository class not injected correctly

Dirk Ho dirk_studivz at web.de
Mon Aug 4 10:40:10 CEST 2014


Very thanks, Ivano!

I guess your hint to rebuild the project in Extension Builder would be 
the best option. The code I actually modified is not so much and only 
for testing / playing around purposes.

Could you (or anyone else) please give me a last hint to Extension Builder:

If I add a new relation in my Model Category to the Model Forum, do I 
have to add the $forums variable to the Category Model AND add the 
$category variable to the Model Forum and connect each other with the 
lines I can pull?

Or do I only add it in Model Category and then pull the line to the 
Model name Forum (at the top of each model I can add lines to, as well 
as to attributes in the relations section).

Or does it not matter at all, as long as there is a relation line 
between both Models?

Thanks and best wishes,
Dirk

Am 03.08.2014 23:03, schrieb Ivano Luberti:
> I don't think it really matters: what is important is to have the getter
> and setter method named correctly so if you have . Ayway use
>
> $forums
>
> For clairty matters: you have to write two methods
>
> getForums()
>
> and setForums()
>
> commented accordingly of course.
>
> About Extensionn Builder not modifying model.....if it was a matter of
> rights you should see some error messages. So I don't think this is the
> case.
> Try looking at
>
> \DH\Forum\Configuration\ExtensionBuilder\settings.yaml
>
> read the comment at the beginning  of the files for explanation.
>
> Another possibility is that you have modified manually something and now
> there is incoherence between all the files content and the mapping built
> by Extension Builder in:
>
> \DH\Forum\ExtensionBuilder.json
>
> In this case if you want to keep using Extension Builder for this
> project and it would be be better to rebuild the model from scratch and
> then import the code modifications you have made.
>
> Good luck! :-)
>
>
>
>
> Il 03/08/2014 20:51, Dirk Ho ha scritto:
>> I'm very sorry for asking again:
>>
>> @var
>> \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DH\Forum\Domain\Model\Forum>
>>
>> What's the name of the variable?
>> $forum?
>> $forums?
>>
>> I don't know if in this case a plural "s" is added to the variable
>> name or if just the singular of the model is used.
>>
>> Am 02.08.2014 22:55, schrieb Ivano Luberti:
>>> For what I see in the comment of $category declaration you have:
>>>
>>>>        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<>
>>>
>>> but you should have
>>>
>>>>        * @var \DH\Forum\Domain\Model\Category >
>>>
>>> because a forum can have only one category
>>>
>>> While in CategoryModel you should have
>>>
>>>>        * @var
>>>> \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\DH\Forum\Domain\Model\Forum
>>>>
>>>>>
>>>
>>> to list all forums for a given Cateogry
>>>
>>> if you don't specify the type Extbase cannot determine it.
>>>
>>>
>>> I think that for initial development you should use Extension Builder:
>>> it generates automatically this kind of things and you could learn a lot
>>> browsing the code.
>>> Roundtripping  can be cumbersome expecially once you start editing
>>> templates, typoscript and other configuration fields but the initial
>>> development works well especially for newbies.
>>>
>>>
>>
>> _______________________________________________
>> 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