Your case is well documented in symfony website titled "How to generate Entities from an Existing Database"
As the documentation stated:
The first step towards building entity classes from an existing
database is to ask Doctrine to introspect the database and generate
the corresponding metadata files. Metadata files describe the entity
class to generate based on table fields.
Using following command (assuming your bundle's short name is GOutsideGOBundle)
$ php app/console doctrine:mapping:import --force GOutsideGOBundle xml
Then you need to call.
php app/console doctrine:generate:entities GOutsideGOBundle
If you need to generate entity classes with annotation mappings, then you have to execute the following command before doctrine:generate:entities
php app/console doctrine:mapping:convert annotation ./src
Path should be only ./src instead of ./src/GOutside/GOBundle/Resources/config/doctrine
Updated:
If everything is correct in your configuration then getting the error Database does not have any mapping information.
is unlikely!! I am not sure about this error. But as per your database table schema, there are some issue which will prevent you from creating mapping information.
- Your table contain special type point which doctrine can't handle.
- You database table has multiple table without any primary key. Doctrine does not support reverse engineering from tables that don't have a primary key
To solve problem (1) you can add a custom mapping in your doctrine config section. For example to map the point type as string you can write:
doctrine:
dbal:
//Other connection parameters
mapping_types:
point: string
for the second problem you need to define primary key for those tables, those could be new field or could be composite primary key.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…