- Seme Framework
- version 4.0.3
- Requirements
- Download & Install
- Configuration
- Tutorials
- URI Routing
- Constants
- Global Variables
- Model
- View
- Controller
- cdn_url
- config
- constructor
- getAdditional
- getAdditionalBefore
- getAdditionalAfter
- getAuthor
- getCanonical
- getContentLanguage
- getDescription
- getIcon
- getJsContent
- getJsFooter
- getJsReady
- getKey
- getKeyword
- getLang
- getRobots
- getShortcutIcon
- getThemeElement
- getTitle
- input
- lib
- load
- loadCss
- loadLayout
- putThemeContent
- putJsContent
- putJsFooter
- putJsReady
- render
- resetThemeContent
- session
- setAuthor
- setCanonical
- setContentLanguage
- setDescription
- setIcon
- setKey
- setKeyword
- setLang
- setShortcutIcon
- setTheme
- setTitle
- Library
- CLI (command line interface)
- Core
- Issue
- Deployment
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
Parameters
join_composite method has 4 required parameters and will returned dbObject
$TABLE_NAME
The table for joined with current table.
$TABLE_NAME_ALIAS
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
JOIN_TYPE value. Default empty string. Value consist of inner, outer, left, right.
Sample Usage
Here is the example usage from join_composite method on d_sales_model.php file.
class D_Sales_Model extends SENE_Model{
public $table = 'd_sales';
public $table_alias = 'dsl';
public $table2 = 'b_seller';
public $table2_alias = 'bs';
public function __construct(){
parent::__construct();
$this->db->from($this->table,$this->table_alias);
}
private function __jointable2(){
$composites = array();
$composites[] = $this->db->composite_create("$this->table_alias.nation_code","=","$this->table_alias.nation_code");
$composites[] = $this->db->composite_create("$this->table_alias.b_seller_id","=","$this->table_alias.id");
return $composites;
}
public function getByOrderId($id){
$this->db->join_composite($this->table2,$this->table2_alias,$this->__jointable2(),"inner");
$this->db->where_as("$this->table_alias.id",$this->db->esc($id));
return $this->db->get_first();
}
}