PHP Classes

File: examples/orm/JoinPostMapper.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/orm/JoinPostMapper.php   Download  
File: examples/orm/JoinPostMapper.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 484 bytes
 

Contents

Class file image Download
<?php

#require_once('A/Orm/DataMapper.php');

class JoinPostMapper extends A_Orm_Datamapper {

    public function
__construct($db) {
       
parent::__construct($db, 'Post','posts');
       
$this->map('id:key','title AS title','posts.body AS body');
       
//$this->map('author_first_name')->toColumn('users.first_name');
        //$this->map('author_last_name')->toColumn('users.last_name');
        //$this->innerJoin('users')->on('id','author_id');
       
$this->join('users ON (users.id = posts.author_id');
    }

}