I created a Product.php
file in my bundle Mingle\StandardBundle\Entity
like this:
<?php
namespace Mingle\StandardBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/*
* @ORM\Entity
* @ORM\Table(name="product")
*/
class Product
{
/*
* @ORM\Column(type="integer")
* @ORM\ID
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/*
* @ORM\Column(type="string",length=100)
*/
protected $name;
/*
* @ORM\Column(type="decimal",scale=2)
*/
protected $price;
/*
* @ORM\Column(type="text")
*/
protected $description;
}
?>
In Ubuntu Terminal, at root folder of Symfony project, I typed this command:
php app/console doctrine:generate:entities Mingle/StandardBundle/Entity/Product
And I encountered problem:
[Doctrine\ORM\Mapping\MappingException]
Class "Mingle\StandardBundle\Entity\Product" is not a valid entity or mapped super class.
And I don't know how to solve even after searching. Please help