[TYPO3-mvc] DI requirements

Claus Fassing claus at fassing.eu
Sat Jan 22 00:08:37 CET 2011


Hello,

I try to use to inject an own service class with DI inside my validator
class where I use already successful injection of ConfigurationManager
class, so DI is working basically.

/**
* Inject fileService
*
* @param Tx_Mioffers_Service_FileService
* @return void
*/
public function injectFileService(Tx_Mioffers_Service_FileService
$fileService){
  //$this->fileService = $fileService;
}

class Tx_Mioffers_Service_FileService {
  public function foobar(){		
  }
}

Break down every function to catch what's going wrong, but I always get
a WrongScope Exception called "Setter dependencies can only be
singletons" (1292860859).

I try to use an interface and remove as you can see every functionality,
but without success. Looks like it is not only to do with an inject
method. What are the basics, or what do my FileService class missing to
get this work ?

Greetz Claus


More information about the TYPO3-project-typo3v4mvc mailing list