2013-08-07 68 views
0

我仍然在試圖使用從sylius車捆綁,實體管理器的symfony 2

我得到這個錯誤

Catchable Fatal Error: Argument 1 passed to myproject\Cart\ItemResolver::__construct()   must be an instance of Doctrine\ORM\EntityManager, none given, called in  myproject\cache\dev\appDevDebugProjectContainer.php on line 3625 and defined in myproject\Cart\ItemResolver.php line 19 
500 Internal Server Error - ContextErrorException 
其實

我已經在調試堆棧跟蹤看到了這一點

at ItemResolver ->__construct() 

protected function getcompany_CartItemResolverService() 
{ 
return $this->services['company_item_resolver'] = new \myproject\Cart\ItemResolver(); 
} 

我想我的配置有問題。

我service.yml看起來像

company.cart_item_resolver: 
class: myproject\Cart\ItemResolver 
argument: ['@doctrine.orm.entity_manager'] 

和我的教義config.yml樣子:

orm: 
auto_generate_proxy_classes: "%kernel.debug%" 
entity_managers: 
    default: 
     mappings: 
      ApplicationSonataUserBundle: ~ 
      SonataUserBundle: ~ 
      FOSUserBundle: ~ 
      companyBundle: ~ 
      ApplicationSonataMediaBundle: ~ 
      SonataMediaBundle: ~ 
      SonataNotificationBundle: ~ 
      ApplicationSonataNotificationBundle: ~ 
      SyliusCartBundle: ~ 

我沒有自動映射啓用,我想我的服務參數。 yml應該是假的,但我沒有設法正確。

你能幫我嗎?

+0

這是一個錯字。它應該是'參數'而不是'參數' – Touki

+0

嘿,我已經遲到了,它是我找到它的正確答案。只是回來給出答案,但你給它thx :) –

回答

相關問題