News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Zend Developer Zone:
DataModeler Simple ORM - Part 2 Saving Models
September 22, 2010 @ 09:37:46

In his previous post Vic Cherubini introduced his namespaced DataModler ORM class and showed how to create a basic model to work with user information to the database. In this second part he looks at taking those models and saving their contents to the database.

After you have created your Models, it's time to save them to a datastore. DataModeler requires you to use PDO as the abstraction layer as it makes use of prepared statements and database specific extensions.

He bases it all on PDO object - created and pushed in via dependency injection. The model then uses that object and executes a "save()" containing the data created in the model request. He also talks about "dumb loads", a feature that lets the modeler think it was loaded without having to know anything more than just the object's ID number.

1 comment voice your opinion now!
datamapper orm tutoral namespace pdo


blog comments powered by Disqus

Similar Posts

Bshensky\'s LiveJournal: Oracle Support without a Recompile

Tobias Schlitt's Blog: iRefuseToUse aNamingScheme

David Coallier's Blog: PHP Namespaces (Part 1: Basic usage & gotchas)

Chris Hartjes' Blog: Namespaces in PHP? Why *wouldn't* you want them?

PHPClasses.org: Learning PHP Data Objects (Book Review)


Community Events

Don't see your event here?
Let us know!


podcast laravel5 voicesoftheelephpant psr7 opinion video library development extension api laravel interview series conference introduction release community unittest framework language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework