Answer the question
In order to leave comments, you need to log in
What is the reason for the "Class Foo is not a valid entity or mapped super class." error?
Good day!
There is an essence
<?php
namespace Main\CatalogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Main\CatalogBundle\Repository\ShopCategoriesRepository")
* @ORM\Table(name="shop_categories")
*/
class ShopCategories
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
*@ORM\Column(type="integer", name="shop_id")
*/
private $shopId;
/**
* @ORM\Column(type="string")
*/
private $name;
/**
* @ORM\Column(type="integer", name="category_id")
*/
private $categoryId;
/**
* @ORM\Column(type="integer")
*/
private $parent;
/**
* @ORM\Column(type="smallint")
*/
private $status;
/**
* @ORM\Column(type="integer", name="total_products")
*/
private $totalProducts;
/**
* @ORM\Column(type="integer", name="unknown_products")
*/
private $unknownProducts;
/**
* @ORM\Column(type="intger", name="false_products")
*/
private $falseProducts;
}
[Doctrine\ORM\Mapping\MappingException]
Class "Main\CatalogBundle\Entity\ShopCategories" is not a valid entity or
mapped super class.
Answer the question
In order to leave comments, you need to log in
This exception is thrown by DisconnectedMetadataFactory and Driver/*Driver.
Most likely the problem is not in the first.
Also note that only ONE format is supported. Annotations, yml, xml...
There should be nothing in the Main/CatalogBundle/Resources/doctrine/ folder if you use annotations.
https://github.com/symfony/symfony/issues/4554
First, you are describing something wrong. Where are the connections? What's the shopId
, categoryId
, parent
? Read about association mapping
Secondly:
/**here
* @ORM\Column(type="intger", name="false_products")
*/
private $falseProducts;
intger
and needinteger
What do you have in config.yml in the doctrine section?
stackoverflow.com/questions/20887211/how-to-fix-cl...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question