我收到此错误:
[语义错误]属性Entity \ Site :: $ id中的注释“@HireVoice \ Neo4j \ Annotation”不存在,或者无法自动加载。
这是Entity / Site.php:
namespace Entity; use HireVoice\Neo4j\Annotation as OGM; use Doctrine\Common\Collections\ArrayCollection; /** * Class Site * @OGM\Entity(repositoryClass="Repository\SiteRepository") */ class Site { /** * @OGM/Auto */ protected $id; /** * @OGM/Property */ protected $name; /** * @OGM/Property * @OGM/Index */ protected $domain; /** * @OGM/Property */ protected $url; /** * @OGM/Property * @OGM/Index */ protected $created; public function setName($name) { $this->name = $name; } public function setDomain($domain) { $this->domain = $domain; } public function setUrl($url) { $this->url = $url; } public function setCreated($created) { $this->created = $created; } public function getName() { return $this->name; } public function getDomain() { return $this->domain; } public function getUrl() { return $this->url; } public function getCreated() { return $this->created; } }
这是Repository / SiteRepository.php:
namespace Repository; use HireVoice\Neo4j\Repository as BaseRepository; class SiteRepository extends BaseRepository { }
答案 0 :(得分:1)
哦翻转A.刚刚意识到@ OGM /需要改为@OGM \