2014-12-27 37 views
1

我得到的Symfony2應用以下錯誤發現Symfony2的 - 「類XXX是不是在鏈配置的命名空間

」類‘Stocksolutions \ ShopBundle \實體\圖片’鏈配置的命名空間沒有被發現StockSolutions \ UserBundle \實體,StockSolutions \ ShopBundle \實體,Vlabs \ MediaBundle \實體,FOS \ UserBundle \型號」

這是一種奇怪恕我直言,因爲StockSolutions\ShopBundle\Entity在配置的命名空間。當我安裝vlabs媒體包時出現此錯誤。

這裏我像實體

<?php 

namespace Stocksolutions\ShopBundle\Entity; 

use Doctrine\ORM\Mapping as ORM; 
use Vlabs\MediaBundle\Entity\BaseFile as VlabsFile; 
use Symfony\Component\Validator\Constraints as Assert; 

/** 
* Stocksolutions\ShopBundle\Entity\Image 
* 
* @ORM\Entity 
* @ORM\Table(name="image") 
*/ 
class Image extends VlabsFile 
{ 
    /** 
    * @var string $path 
    * 
    * @ORM\Column(name="path", type="string", length=255) 
    * @Assert\Image() 
    */ 
    private $path; 

    /** 
    * Set path 
    * 
    * @param string $path 
    * @return Image 
    */ 
    public function setPath($path) 
    { 
     $this->path = $path; 

      return $this; 
    } 

    /** 
    * Get path 
    * 
    * @return string 
    */ 
    public function getPath() 
    { 
     return $this->path; 
    } 
} 

我在config.yml文件auto_mapping: true

任何熟悉這個問題的人?

回答

2

我想你應該寫

namespace StockSolutions\ShopBundle\Entity; 

,而不是

namespace Stocksolutions\ShopBundle\Entity; 
相關問題