I am trying to get the Stof\DoctrineExtensionsBundle to run to be able to use DoctrineExtensions easily. However, the PHP interpreter tells me:
No identifier/primary key specified for Entity 'Stof\DoctrineExtensionsBundle\Entity\Translation'. Every Entity must have an identifier/primary key.
Does anyone know how to circumvent this problem? I guess it is possible somewhere in the annotations of Doctrine2, but I do not understand it that much and there already is an "orm:index" value (renaming it by "orm:Id", which seems to be the required value, does not work).
That’s the code of Translation entity class shipped 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, that’s the git repository if this helps anything. But I was not able to find this point within the documentation: https://github.com/stof/DoctrineExtensionsBundle
You can try to disable the stofdoctrineextensions in your app/config/config.yml before generate your entities getters/setters like this:
mappings:
        StofDoctrineExtensionsBundle: false
Looks like the entities generator doesn't support external mapping yet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With