BEST Offers , For All Sximo 5 LTS licence Holer , Upgrade Licence For only $14 Normal Price on Codecanyon $31
New product Sximopress ( Wordpress Builder ) 1.0 has been realesed . download it now !

S5 Ultimate

The Real PHP Application Makers

Join & Relation

Relation

Relation is a way to displaying row columns value and automatic create dropdown select using database . its similiar like lookup option at format( ) method , check here

Method

relation()

Params & Arguments

This method required 4 mandatory argument
relation('keyJoin','tableRelation','keyMaster','fieldToDisplay')

Explanation

  • KeyJoin = foreignKey from relation table connected to master table
  • TableRelation = Relatiion Database Table name
  • KeyMaster = Field from master table connected to relation table
  • fieldToDisplay = Display fields from table relation

Example

This method required 4 mandatory argument
$CrudEngine->table('empoyees)
           ->relation('officeCode','offices','officeCode','city')
           ->render();

Join Table

This method / function allows you to join other tables. You can use , Inner Join , Left Join, Right Join as supported . Not like relation( ) method , join( ) allow you to display fields from joined table

Method

join()

Params & Arguments

This method required 4 mandatory argument and 1 optional param
join('tableJoin','masterTable.masterKey','tableJoin.joinKey')

Example

$CrudEngine->table('employees')
           ->join('offices','employees.officeCode','offices.officeCode','left')
           ->render();

Display field(s) from joined table

When displaying fields from joined table , remember you must use table name and field ex table.field
$CrudEngine->table('employees')
           ->join('officeCode','offices','officeCode','left')
           ->display(' fistName , lastName , offices.city , offices.countryName')          
           ->render();

Please Register Purchased Code for full access Docs


Last Update : 2017-10-14 06:46:34