mercredi 26 juillet 2017

Error While Creating the schema for doctroin

I have tried to create the database schema by running the artisan command through CLI and got the following error:

The annotation "@Doctrine\ORM\Mapping\Names" in property App\Entity\Vouchers::$names does not exist, or could not be auto-loaded.

Following the Code for my Entity.

 namespace App\Entity;

 use Doctrine\ORM\Mapping as ORM;

 /**
 * @ORM\Entity
 * @ORM\Table(name="vouchers")
 **/
 class Vouchers
 {
 /**
 * @var integer $id
 * @ORM\Column(name="id", type="integer", unique=true, nullable=false)
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="AUTO")
 *
 */
private $id;

/**
 * @var string $names
 * @ORM\Column(name="names", type="string", unique=false, nullable=false)
 * @ORM\Names
 *
 */
private $names;

 /**
 * @var string $amount
 * @ORM\Column(name="amount", type="string", unique=false, nullable=false)
 * @ORM\Amount
 *
 */
 private $amount;


 //Getter And Setters

 //ID
 public function getId()
 {
    return $this->id;
 }

//name

public function getName()
{
    return $this->name;
}

public function setName($name)
{
    $this->name = $name;
}

//amount

public function getAmount()
{
    return $this->amount;
}

public function setAmount($amount)
{
    $this->amount = $amount;
}
}

Please check and let me know if there is any mistake i have made in the above code and how it can be fixed. I have tried many other solution but still i am not able to figure this out.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire