Wednesday 15 February 2012

php - Symfony2 FOSUserBundle can't update doctrine database schema or clear cache -



php - Symfony2 FOSUserBundle can't update doctrine database schema or clear cache -

i'm trying larn how registration symfony2 , fosuserbundle. doing step step documentation provided in: https://github.com/friendsofsymfony/fosuserbundle/blob/master/resources/doc/index.md when seek run comman php app/console doctrine:schema:update --force error:

[doctrine\orm\mapping\mappingexception] no identifier/primary key specified entity "registration\businessbundle\entity\businessuser" sub class of "fos\userbundle\model\user". every entity must have identifier/primary key.

if run command php app/console cache:clear same error. tried deleting cache folder manually when seek update doctrine schema, 1 time again same error appears.

my businessuser entity:

<?php namespace registration\businessbundle\entity; utilize fos\userbundle\model\user baseuser; utilize doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(name="business_user") */ class businessuser extends baseuser { /* * @orm\column(type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; public function __construct() { parent::__construct(); } }

since set question 2 times in stackoverflow, re-create , paste answer:

your entity not contain php docblock comments doctrine annotation used.

docblocks startet 2 asterisks, otherwise it's simple comment.

change current code

/* * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id;

to

/** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id;

only /** annotations recognized doctrine.

check other properties too.

php symfony2 doctrine2 doctrine fosuserbundle

No comments:

Post a Comment