ORM with PHP

Yes, in my opinion PHP is still one of the best solution to build complex web 2.0 applications.

There are a lot of great PHP Frameworks out there which makes your life easier (Symfony, CakePHP, Codeigniter, and more…).

Now you can enjoy 100% Object-relational mapping in PHP by using IgnitedRecord library under the Codeigniter framework.

Here is a snapshot of how ORM can be achieved with PHP:

$this->load->model(‘ignitedrecord/ignitedrecord’);

$this->post = IgnitedRecord::factory(‘posts’);
$this->post->belongs_to(‘user’)->fk(‘author’);

$posts = $this->post->like(‘CodeIgniter’)
->order_by(‘date’, ‘desc’)
->join_related(‘user’)
->find_all();

foreach($posts as $post){
echo $post->title;
echo $post->user_username;
}

No Comments so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>