1
DB $ symfony propel-build-schema xml MODEL CLASSES /lib/model/om /lib/model /lib/model/map Object/Relational Mapping (ORM) use use SYMFONY CLI $ symfony propel-build-model generate myproject/config describe use Database Abstraction metadata information about the table base classes, modified by propel build model files used to add custom methods and properties to the model objects blog_article blog_comment id title content created_at article_id (FK) author content created_at id DATABASE SYMFONY FRAMEWORK myproject/config or apps/myapp/config PROPEL CREOLE $ symfony propel-generate-crud $ symfony propel-build-sql $ symfony propel-build-db $ symfony propel-insert-sql (only database commands) same information generate use BaseArticle.php BaseArticlePeer.php BaseComment.php BaseCommentPeer.php Article.php ArticlePeer.php Comment.php CommentPeer.php use generate propel.ini schema.yml schema.xml database.yml use ArticleMapBuilder.php CommentMapBuilder.php PostgreSQL Oracle MySQL SQL Server SQLite description of the relational model to do the mapping DB connection settings and propel configuration DB connection settings to access the data model symfony ORM http://andreiabohner.wordpress.com

Symfony ORM

Embed Size (px)

Citation preview

Page 1: Symfony ORM

DB

$ symfony propel-build-schema xml

MODEL CLASSES

/lib/model/om

/lib/model

/lib/model/map

Object/RelationalMapping (ORM)use

use

SYMFONY CLI

$ symfony propel-build-model generate

myproject/config

describe

use

Database Abstraction

metadata information about the table

base classes,modified by propel build model

files used to addcustom methodsand properties tothe model objectsblog_article blog_commentidtitlecontentcreated_at article_id (FK)authorcontentcreated_at

idDATABASE SYMFONY FRAMEWORK

myproject/configorapps/myapp/config

PROPELCREOLE

$ symfony propel-generate-crud

$ symfony propel-build-sql

$ symfony propel-build-db

$ symfony propel-insert-sql(only database commands)

same information

generate useBaseArticle.phpBaseArticlePeer.phpBaseComment.phpBaseCommentPeer.php

Article.phpArticlePeer.phpComment.phpCommentPeer.php

usegenerate

propel.ini

schema.yml schema.xml

database.yml

use

ArticleMapBuilder.phpCommentMapBuilder.php

PostgreSQLOracleMySQLSQL ServerSQLitedescription of the relational model to do the mapping

DB connectionsettings andpropel configuration DB connectionsettings to access the data model

symfony ORM

http://andreiabohner.wordpress.com