Page 1 of 1

Database Object Access

Posted: Wed Dec 16, 2009 6:57 pm
by fornve
Hi Everyone,

Maybe someone else will find this usefull.

In all my Joomla! projects if I have to create new tables, I use DAO layer.

For example if I want to deal with table jos_content (or any new) I create entity class for it: ... .class.php

To retrieve by $content_id:

Code: Select all

$content = Content::Retrieve( $content_id );
$content->title = 'New title';
Or create new one

Code: Select all

$content = new Content();
$content->title = 'New content';
There is possible to add extra methods to entity classes, and on Retrieve.
There is one crazy example of entity class: ... .class.php

It is really usefull.

Project repository:

Just seeded, I haven't decided yet where is best place for entities directory. I am Joomla! beginner ;)

Any comments welcome.

Re: Database Object Access

Posted: Mon Jan 04, 2010 3:30 pm
by fornve
I am proud to release Joomla Dao Plugin - for Joomla! 1.5 and 1.6

Download latest:

More about:

This plugin does it for you. Makes code cleaner, even more objcet orientated and speeds up development a lot.
Also I recommend it to all Joomla! Developers who are not bothered escaping input strings (JDatabase::getEscaped) Entity::Save does it for you.