Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 No Metadata Classes to process

After creating entity with:

php app/console doctrine:generate:entity

and while using:

php app/console doctrine:schema:update --force

I encountered:

No Metadata Classes to process.

Entity

namespace ISLab\AdminBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

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

    /**
     * @ORM\Column(name="parent", type="integer")
     */
    private $parent;

    // ...
}
like image 996
Ivan Avatar asked Mar 08 '14 10:03

Ivan


2 Answers

I had a similar problem and took me a while until I find out how to clear out the cache. Clearing only doctrine's cache did not work for me. Use the command below to clear the entire environment (production one in this case)

php app/console cache:clear --env=prod

like image 177
MarcSitges Avatar answered Oct 19 '22 23:10

MarcSitges


I had the same problem when I generate an Entity through the interactive generator from command line. When I first created I set the Configuration Format to PHP and that didn't work. So I deleted it and tried again but this time I selected format = annotation. Then it worked! Maybe this could solve someone's problem.

like image 24
pdolinaj Avatar answered Oct 20 '22 01:10

pdolinaj