[TYPO3-mvc] Using Repository outside extbase
Xavier Perseguers
typo3 at perseguers.ch
Sun Jul 12 08:16:10 CEST 2009
Hi,
>> Before the persistence-rewrite, I simple used:
>> $this->catRepository =
>> t3lib_div::makeInstance('Tx_MyExample_Domain_Model_CatRepository');
>>
>>
>> Now I always get the following error:
>> Catchable fatal error: Argument 1 passed to
>> Tx_Extbase_Persistence_Manager::__construct() must be an instance of
>> Tx_Extbase_Persistence_BackendInterface, none given, called in
>> /var/www/model/web/typo3_4.3svn/t3lib/class.t3lib_div.php on line 4828
>> and defined in
>> /var/www/model/web/extbase/Classes/Persistence/Manager.php on line 59
>
> This happens because inside the constructor of the
> Tx_Extbase_Persistence_Repository there is the following line
>
> $this->persistenceManager =
> t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager'); // singleton;
> must have been initialized before (constructor argument)
>
> My technique to (mis)use a singleton as a "global" object is indeed not
> very clever (well, maybe "clever" but not "smart" ;-) ).
>
> I will change this on Monday.
Perfect. I encountered the very same problem and simply switch back to
the "stable" revision for the time being, because I knew this would
probably still change a bit :-)
Have a nice Sunday
--
Xavier Perseguers
http://xavier.perseguers.ch/en
One contribution a day keeps the fork away
More information about the TYPO3-project-typo3v4mvc
mailing list