php - What kind of entities i should create in doctrine for this db structure -


i have 2 tables in db (topic, topic_content):

db structure

what kind of entities should create symfony2? think, should have in symfony structure (entities/topic.php, entities/topic_content.php) me please..

yes, create topic , topic content. , user entity (because user_id looks foreign key).

however, idea in symfony2 approach application model site instead of database site. quoting https://doctrine-orm.readthedocs.org/en/latest/tutorials/getting-started-database.html:

development workflows

when code first, start developing objects , map them onto database. when model first, modelling application using tools (for example uml) , generate database schema , php code model. when have database first, have database schema , generate corresponding php code it.

for database first, there generator derive objects based on schema:

the recommended approach though have doctrine generate db schema entities.

quoting getting started - generating db schema

doctrine has command-line interface allows access schematool, component generates required tables work metadata.

it requires setup, explained in guide. once have that, tell doctrine generate or update schema, whenever object structure changes.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -