注释“ @Doctrine \ ORM \ Mapping \ column”:$ status不存在,或者无法自动加载

时间:2018-07-18 11:56:23

标签: symfony-3.4

[语义错误]属性AppBundle \ Entity \ Product :: $ status中的注释“ @Doctrine \ ORM \ Mapping \ column”不存在,或者无法自动加载。

这是错误 我正在使用symfony 3.4

............................................... ................................................... ................................................... .............

这是实体

<?php

    namespace AppBundle\Entity;
    use Doctrine\ORM\Mapping as ORM;
    use Symfony\Component\Validator\Constraints as Assert;
    use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
    /**
     * Product
     */
    class Product
    {
        /**
         * @var int
         */
        private $id;

        /**
         * @var string
         */
        private $productname;

        /**
         * @var string
         * @ORM\column(name="status",type="string",length=255)
         */
        private $status;


        /**
         * @var string
         */
        private $specification;

        /**
         * @var int
         */
        private $phone;

        /**
         * @var int
         */
        private $price;


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

        /**
         * Set productname
         *
         * @param string $productname
         *
         * @return Product
         */
        public function setProductname($productname)
        {
            $this->productname = $productname;

            return $this;
        }

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

        /**
         * Set specification
         *
         * @param string $specification
         *
         * @return Product
         */
        public function setSpecification($specification)
        {
            $this->specification = $specification;

            return $this;
        }

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

        /**
         * Set phone
         *
         * @param integer $phone
         *
         * @return Product
         */
        public function setPhone($phone)
        {
            $this->phone = $phone;

            return $this;
        }

        /**
         * Get phone
         *
         * @return int
         */
        public function getPhone()
        {
            return $this->phone;
        }

        /**
         * Set price
         *
         * @param integer $price
         *
         * @return Product
         */
        public function setPrice($price)
        {
            $this->price = $price;

            return $this;
        }

        /**
         * Get price
         *
         * @return int
         */
        public function getPrice()
        {
            return $this->price;
        }



        /**
         * Set status
         *
         * @param string $status
         *
         * @return Product
         */
        public function setStatus($status)
        {
            $this->status = $status;

            return $this->status;
        }

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

1 个答案:

答案 0 :(得分:0)

我错了。 在

public function setStatus()

制作return $this->status;return $this; 和 删除

@Orm\column(name='status',type='string,length=255')