Select::JoinAdd
Add a join to relationship Sintaxe
namespace
ProtocolLive\PhpLiveDb;
use ProtocolLive\PhpLiveDb\Enums\Joins; final class Select{
public function
JoinAdd(
}
string|UnitEnum
$Table,
):self;
string|null|UnitEnum $Using = null, string|null $On = null, Joins $Type = Joins::Left Parameters
$Table - The table name. Can be specify an alias; $Using - The SQL "using" relationship field; $On - The SQL "on" relationship field; $Type - The relationship type; See more
- Joins Examples
$consult
= $Db->Select('users'); $consult->JoinAdd('socialmedias', 'user_id'); $consult->Run(); //select * from users left join socialmedias using('user_id')
$consult
= $Db->Select('users'); $consult->JoinAdd('socialmedias', On: 'users.id=socialmedias.user_id'); $consult->Run(); //select * from users left join socialmedias on users.id=socialmedias.user_id |
*/