简体   繁体   English

属性中的注释不存在,或者无法自动加载

[英]The annotation in property does not exist, or could not be auto-loaded

I'm using Symfony 2.7 - When I want to generate getters and setters they tell me that: 我正在使用Symfony 2.7-当我想生成getter和setter时,他们告诉我:

The annotation "@doctrine\ORM\mapping" in property MostVenteBundle\Entity\commande::$lignes_cmd does not exist, or could not be auto-loaded
<?php

namespace Most\VenteBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * commande
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class commande
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="date_cmd", type="date")
     */
    private $dateCmd;

    /**
     * @var string
     *
     * @ORM\Column(name="adresse_liv", type="string", length=33)
     */
    private $adresseLiv;

    /**
     * @ORM\ManyToOne(targetEntity="Client", inversedBy="commandes")
     * @ORM\joinColumn(name="id_client", referencedColumnName="id")
     */
    private $client;


    /**    
     * @ORM/OneToMany(targetEntity="ligne_cmd", mappedBy="commande")     
     */
    private $lignes_cmd;

    public function __construct()
    {
        $this->lignes_cmd = new \Doctrine\Common\Collection\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set dateCmd
     *
     * @param \DateTime $dateCmd
     * @return commande
     */
    public function setDateCmd($dateCmd)
    {
        $this->dateCmd = $dateCmd;

        return $this;
    }

    /**
     * Get dateCmd
     *
     * @return \DateTime 
     */
    public function getDateCmd()
    {
        return $this->dateCmd;
    }

    /**
     * Set adresseLiv
     *
     * @param string $adresseLiv
     * @return commande
     */
    public function setAdresseLiv($adresseLiv)
    {
        $this->adresseLiv = $adresseLiv;

        return $this;
    }

    /**
     * Get adresseLiv
     *
     * @return string 
     */
    public function getAdresseLiv()
    {
        return $this->adresseLiv;
    }
}
/**    
 * @ORM\OneToMany(targetEntity="ligne_cmd", mappedBy="commande")     
 */
private $lignes_cmd;

you wrote @ORM/OneToMany instead of @ORM\\OneToMany 您编写@ ORM / OneToMany而不是@ORM \\ OneToMany

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 注释不存在,或无法自动加载 - The annotation does not exist, or could not be auto-loaded Symfony2注释“ @Gedmo \\ Mapping \\ Annotation \\ Timestampable”不存在,或者无法自动加载 - Symfony2 The annotation “@Gedmo\Mapping\Annotation\Timestampable” does not exist, or could not be auto-loaded Symfony4 : 注释不存在,或无法自动加载 (Symfony\\Component\\Validator\\Constraints) - Symfony4 : The annotation does not exist, or could not be auto-loaded (Symfony\Component\Validator\Constraints) Entities \\ USER_User类中的注释“@Doctrine \\ ORM \\ Mapping \\ Entity”不存在,或者无法自动加载 - The annotation “@Doctrine\ORM\Mapping\Entity” in class Entities\USER_User does not exist, or could not be auto-loaded JMSSerializer独立 - 注释不存在,或者无法自动加载 - JMSSerializer stand alone - Annotation does not exist, or cannot be auto-loaded 自定义约束验证器不存在,或无法自动加载 - Custom constraint validator does not exist, or could not be auto-loaded symfony 3 [语义错误]类AppBundle \\ Entity \\ User中的注释@Doctrine \\ ORM \\ Mapping \\ Model不存在,或者无法自动加载 - symfony 3 [Semantical Error] The annotation @Doctrine\ORM\Mapping\Model in class AppBundle\Entity\User does not exist, or could not be auto-loaded Symfony 2 - 属性中的注释不存在,或者无法自动加载。 - Symfony 2 - The annotation in property does not exist, or could not be auto-loaded. Doctrine 2 Gedmo扩展无法正常工作并出现错误:“不存在,或无法自动加载” - Doctrine 2 Gedmo extensions not working with error: “does not exist, or could not be auto-loaded” 方法中的“@Sensio\Bundle\FrameworkExtraBundle\Configuration\Route”……不存在,或无法自动加载” - “@Sensio\Bundle\FrameworkExtraBundle\Configuration\Route” in method … does not exist, or could not be auto-loaded"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM