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

Michael Bakonyi kontakt at mb-neuemedien.de
Mon May 26 13:44:48 CEST 2014


Hiho,

in the meanwhile I found the solution on my own: You need to clear the 
cache if you do some something with DI:

http://stackoverflow.com/questions/18594906/how-do-i-inject-a-repository-to-commandcontroller

Btw. a custom function like "findFromCustomStorageFolder" is also needed 
as with findAll the storagePid is not present of course, as you're in a 
different plugin's context:

 >      public function findFromCustomStorageFolder(array $storageFolders){
 >          $query = $this->createQuery();
 >          $query->getQuerySettings()->setStoragePageIds($storageFolders);
 >          return $query->execute();
 >      }

Thx a lot for your help, guys!

Cheers,
Michael

Am 23.05.14 14:39, schrieb Michael Bakonyi:
> Am 23.05.14 13:59, schrieb Wolfgang Klinger:
>>
>> On 23 May 2014, at 13:38, Michael Bakonyi <kontakt at mb-neuemedien.de>
>> wrote:
>>> 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?
>>
>> no, should work that way
>>
>> how does your MailinglistRepository class look like?
>
> Like that:
>
> ...
>
> namespace Civit\MailmanSynch\Domain\Repository;
>
> ...
>
> class MailinglistRepository extends
> \TYPO3\CMS\Extbase\Persistence\Repository {
>
>      public function findFromCustomStorageFolder(array $storageFolders){
>          $query = $this->createQuery();
>          $query->getQuerySettings()->setStoragePageIds($storageFolders);
>          return $query->execute();
>      }
>
> }
>
> Cheers,
> M*




More information about the TYPO3-dev mailing list