Аннотация @Doctrine\ORM\Mapping\column:$status не существует или не может быть загружена автоматически

[Семантическая ошибка] Аннотация "@Doctrine\ORM\Mapping\column" в свойстве AppBundle\Entity\Product::$status не существует или не может быть загружена автоматически.

Это ошибка при использовании 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;
        }
    }

person reinerGeist    schedule 18.07.2018    source источник


Ответы (1)


У меня ошибка. В

public function setStatus()

сделать return $this->status; до return $this; и удалить

@Orm\column(name='status',type='string,length=255')
person reinerGeist    schedule 19.07.2018