[TYPO3-mvc] Save Model in a Schedulertask

Fernando Arconada falcifer2001 at yahoo.es
Sat Mar 26 12:24:40 CET 2011


Hi

Anyone has an example of extbase FE plugin with Ext.Direct reading domain 
objects? I have read http://wiki.typo3.org/ExtDirect but it exports a 
normal class methods but no extbase Actions


Kind Regards

Fernando Arconada

PD: AFAIK the current trunk of mvc_extjs_samples isnt working at this 
moment

El Tue, 22 Mar 2011 13:06:23 +0100, Dennis Ahrens escribió:

> Hi Alexander.
> 
> On 22.03.2011 11:54, Alexander Walther wrote:
>> Hi,
>>
>> i have following method in my Task, but the InstaceModel is not saved.
>>
>> public function execute() {
>>
>>   $this->objectManager =
>> t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');
>>   $this->instaceRepository =
>> $this->objectManager->get
('Tx_T3observer_Domain_Repository_InstaceRepository');
>>
>>   foreach($this->instaceRepository->findAllEverwhere() as $instace){
>>    $observerData =
>>    unserialize(t3lib_div::getURL($instace->getObserverUrl())); if
>>    (is_array($observerData)) {
>>     $instace->setName('test');
>>     $this->instaceRepository->update($instace);
>>    }
>>   }
>>   return true;
>> }
>>
>> Can some tell me what ist wrong.
>>
>> Greetings
>> Alex
> 
> The persistence is handled by Tx_Extbase_Persistence_Manager - when in
> controller context this is called automatically. In your case you have
> to call it manually.
> 
> $persistenceManager =
> $this->objectManager->get('Tx_Extbase_Persistence_Manager');
> $persistenceManager->persistAll();
> 
> regards
> Dennis



More information about the TYPO3-project-typo3v4mvc mailing list