[TYPO3-dev] Include model of ext. A into ext. B

Michael Bakonyi kontakt at mb-neuemedien.de
Fri May 23 13:38:19 CEST 2014


Hi Wolfgang,

thx a lot for your help!

 > No, you simply extend the original class and overwrite what’s missing,
 > not the whole class!

Ah, okay, I didn't get that although I implemented the example from the 
femanager-manual already *bangmyheadagainstthewall*

http://docs.typo3.org/typo3cms/extensions/femanager/ExtfeManager/BestPractice/AddingNewFieldsToFeUsersWithYourOwnExtension/Index.html

So now I extend the EditController and inject the mailinglist-repository 
but it seems like the injection doesn't work correclty as the error 
"Call to a member function findAll() on a non-object" appears. Is there 
anything else I have to know about?

Basically I know that the repository is working as it is included 
correctly within the object FrontendUser – so if a mailinglist is 
checked within the TYPO3-backend it appears within the {user}-debug in 
the Fluid-frontend.

This is my rough code for the EditController:

class EditController extends \In2\Femanager\Controller\EditController {
	
	/**
	 * mailinglistRepository
	 *
	 * @var \Civit\MailmanSynch\Domain\Repository\MailinglistRepository
	 * @inject
	 */
	protected $mailinglistRepository;
	
	public function editAction() {
		$mailinglists = $this->mailinglistRepository->findAll();
		$this->view->assign('mailinglists', $mailinglists);
		parent::editAction($user);
	}
}

Does anybody see a mistake or can give me another tip here?

Cheers,
Michael









Am 23.05.14 10:32, schrieb Wolfgang Klinger:
>
> *hiya!*
>
> On 23 May 2014, at 10:27, Michael Bakonyi <kontakt at mb-neuemedien.de> wrote:
>> thx for your answer!
>>
>> Am 22.05.14 19:16, schrieb Ivano Luberti:
>>>
>>> config.tx_extbase {
>>>    objects {
>>>      Tx_Powermail_Controller_OutputController.className =
>>> Tx_Aippowermail_Controller_OutputController
>>>     }
>>> }
>>
>> If this would be the only solution I would be a little bit disappointed. ;) Because then I would have to always copy the femanager-file over to my ext and make my changes again to the new file when I update femanager (if I understand correctly). So I guess patching the extension would be faster then.
>
> No, you simply extend the original class and overwrite what’s missing,
> not the whole class!
>
>
> kind regards
> Wolfgang
>




More information about the TYPO3-dev mailing list