Join Composite Method

join_composite method purpose is for joining the table with multiple primary key condition. This method are suitable by combining with composite_create method.

Basic Usage

Here is the basic usage of join_composite method.

$this->db->join_composite(string $TABLE_NAME, string $TABLE_NAME_ALIAS, array compositeObjects, string JOIN_TYPE): dbObject


join_composite method has 4 required parameters and will returned dbObject


The table for joined with current table.


The alias table for joined with current table.

Array of Join Composite Object

Value required from array of object can be obtained from composite_create method.


JOIN_TYPE value. Default empty string. Value consist of inner, outer, left, right.

This method available from Seme Framework version >= 3.2.1

Sample Usage

Here is the example usage from join_composite method on d_sales_model.php file.

class D_Sales_Model extends SENE_Model{
  var $tbl = 'd_sales';
  var $tbl_as = 'dsl';
  var $tbl2 = 'b_seller';
  var $tbl2_as = 'bs';

  public function __construct(){
  private function __joinTbl2(){
    $composites = array();
    $composites[] = $this->db->composite_create("$this->tbl_as.nation_code","=","$this->tbl_as.nation_code");
    $composites[] = $this->db->composite_create("$this->tbl_as.b_seller_id","=","$this->");
    return $composites;
  public function getByOrderId($id){
    return $this->db->get_first();