有我的实体:
namespace Catalog\WebBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
class ComCompany
{
private $entityManager;
public function setEntityManager(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
public function getCmpCategory()
{
return $customer = $this
->entityManager
->getRepository('CatalogWebBundle:ComCategory')
->findOneBycmpCat('123123');
}
}
services:
catalog_web.comcompany:
class: Catalog\WebBundle\Entity\ComCompany
calls:
- [ setEntityManager, [ @doctrine.orm.entity_manager ]]
我收到错误:
InvalidArgumentException:没有扩展程序可以加载“catalog_web.comcompany”的配置(在/home/katalogas/domains/ekatalogas.eu/public_html/src/Catalog/WebBundle/DependencyInjection/../Resources /config/services.yml)。查找命名空间“catalog_web.comcompany”,找不到
我不了解problam在services.yml配置文件中的含义。
答案 0 :(得分:0)
您的.yml间距错误。它应该是:
services:
catalog_web.comcompany:
class: Catalog\WebBundle\Entity\ComCompany
calls:
- [ setEntityManager, [ @doctrine.orm.entity_manager ]]