0

In the localhost all things work fine but after I have deployed th project I get this error

[Semantical Error] The annotation "@Gedmo\Mapping\Annotation\slug" in property 
AppBundle\Entity\Product::$slug does not exist, or could not be auto-loaded.

This is the class Product

use Gedmo\Mapping\Annotation as Gedmo;
abstract class Prodcut
{
/**
 * @var int
 *
 * @ORM\Column(name="id", type="integer")
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id;

/**
 * @var string
 *
 * @ORM\Column(name="name", type="string", length=255)
 */
 private $name;

/**
 * @var string
 * @Gedmo\slug(fields={"name"})
 * @ORM\Column(name="slug", type="string", length=255, unique=true)
 */
private $slug;
martin
  • 93,354
  • 25
  • 191
  • 226
hous
  • 2,577
  • 2
  • 27
  • 66

1 Answers1

5

That's because you defined alias for the annotation:

use Gedmo\Mapping\Annotation as Gedmo;

and then used it as @Gedmo\slug(fields={"name"}) which interpolates to:

@Gedmo\Mapping\Annotation\slug(fields={"name"})

Correct name is with capital S:

@Gedmo\Slug(fields={"name"})
martin
  • 93,354
  • 25
  • 191
  • 226