I am trying to run Stof \ DoctrineExtensionsBundle to easily use DoctrineExtensions. However, the PHP interpreter tells me:
There is no identifier / primary key specified for Entity 'Stof \ DoctrineExtensionsBundle \ Entity \ Translation'. Each object must have an identifier / primary key.
Does anyone know how to get around this problem? I guess this is possible somewhere in the Doctrine2 annotations, but I don’t understand this, and there is already the value of “orm: index” (renaming it “orm: Id”, which seems to be the desired value, does not work).
This is the code for the translation entity class supplied with DoctrineExtensions:
/** * Stof\DoctrineExtensionsBundle\Entity\Translation * * @orm:Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository") * @orm:Table( * name="ext_translations", * indexes={@orm:index(name="translations_lookup_idx", columns={ * "locale", "object_class", "foreign_key" * })}, * uniqueConstraints={@orm:UniqueConstraint(name="lookup_unique_idx", columns={ * "locale", "object_class", "foreign_key", "field" * })} * ) */ class Translation extends AbstractTranslation { }
By the way, thats a git repository if this helps something. But I could not find this point in the documentation: https://github.com/stof/DoctrineExtensionsBundle
symfony doctrine2
Aufziehvogel
source share