Do mojej klasy Entity o nazwie Miasta dodałem pole $slug oraz odpowiednie metody get i set. Na chwilę obecną przestawia się to mniej więcej tak:
<?php namespace Moj\PakietBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Miasta */ class Miasta { /** * @var string */ private $nazwa; /** * @var string $slug * * @Gedmo\Slug(fields={"nazwa"}) * @ORM\Column(length=255, unique=true) */ private $slug; .... /** * Set slug * * @param string $slug * @return Miasta */ public function setSlug($slug) { $this->slug = $slug; return $this; } /** * Get slug * * @return string */ public function getSlug() { return $this->slug; } }
Natomiast w pewnym kontrolerze staram się wywołać zapytanie:
Problem w tym że otrzymuję komunikat 'Unrecognized field: slug'. Zapytanie nawet nie jest generowane. Czego jeszcze potrzebuje Symfony żeby kontroler widział to pole? Dodam że Entities generowałem z XML'i.