a-blog cms PHP API Reference

SQL_Trait_Join

SQL_Trait_Join

SQLのJOIN句を生成するためのトレイト

Table of Contents

Properties

$_innerJoins  : array<string|int, SQL_Where|null}>
$_leftJoins  : array<string|int, SQL_Where|null}>
$_straightJoin  : bool

Methods

_join()  : array{sql: string, params: list|array}|null
LEFT JOIN句を生成する
addInnerJoin()  : true
指定されたtableと条件からINNER JOIN句を生成する。<br> $SQL->addInnerJoin('category', 'category_id', 'entry_category_id', 'category', 'acms_entry');<br> INNER JOIN acms_category AS category ON category.category_id = entry.entry_category_id
addLeftJoin()  : true
指定されたtableと条件からtableを結合する。<br> $SQL->addLeftJoin('category', 'category_id', 'entry_category_id', 'category', 'entry');<br> LEFT JOIN acms_category AS category ON category.category_id = entry.entry_category_id
setInnerJoin()  : true
setLeftJoin()  : true
join()  : array{sql: string, params: list|array}
JOIN句を生成する

Properties

$_innerJoins

public array<string|int, SQL_Where|null}> $_innerJoins = []

$_leftJoins

public array<string|int, SQL_Where|null}> $_leftJoins = []

$_straightJoin

public bool $_straightJoin = \false

Methods

_join()

LEFT JOIN句を生成する

public _join(array<string|int, mixed> $join[, string $joinType = "LEFT" ][, Dsn|null $dsn = null ]) : array{sql: string, params: list|array}|null
Parameters
$join : array<string|int, mixed>
$joinType : string = "LEFT"
$dsn : Dsn|null = null
Return values
array{sql: string, params: list|array}|null

addInnerJoin()

指定されたtableと条件からINNER JOIN句を生成する。<br> $SQL->addInnerJoin('category', 'category_id', 'entry_category_id', 'category', 'acms_entry');<br> INNER JOIN acms_category AS category ON category.category_id = entry.entry_category_id

public addInnerJoin(SQL_Select|string $tb, SQL_Field|string $a, SQL_Field|string $b[, string|null $aScp = null ][, string|null $bScp = null ][, SQL_Where|null $where = null ]) : true
Parameters
$tb : SQL_Select|string
$a : SQL_Field|string
$b : SQL_Field|string
$aScp : string|null = null
$bScp : string|null = null
$where : SQL_Where|null = null
Return values
true

addLeftJoin()

指定されたtableと条件からtableを結合する。<br> $SQL->addLeftJoin('category', 'category_id', 'entry_category_id', 'category', 'entry');<br> LEFT JOIN acms_category AS category ON category.category_id = entry.entry_category_id

public addLeftJoin(SQL_Select|string $tb, SQL_Field|string $a, SQL_Field|string $b[, string|null $aScp = null ][, string|null $bScp = null ][, SQL_Where|null $where = null ]) : true
Parameters
$tb : SQL_Select|string
$a : SQL_Field|string
$b : SQL_Field|string
$aScp : string|null = null
$bScp : string|null = null
$where : SQL_Where|null = null
Return values
true

setInnerJoin()

public setInnerJoin([SQL_Select|string|null $tb = null ][, string|null $a = null ][, string|null $b = null ][, string|null $als = null ][, string|null $scp = null ]) : true
Parameters
$tb : SQL_Select|string|null = null
$a : string|null = null
$b : string|null = null
$als : string|null = null
$scp : string|null = null
Return values
true

setLeftJoin()

public setLeftJoin([SQL_Select|string|null $tb = null ][, SQL_Field|string|null $a = null ][, SQL_Field|string|null $b = null ][, string|null $aScp = null ][, string|null $bScp = null ][, SQL_Where|null $where = null ]) : true
Parameters
$tb : SQL_Select|string|null = null
$a : SQL_Field|string|null = null
$b : SQL_Field|string|null = null
$aScp : string|null = null
$bScp : string|null = null
$where : SQL_Where|null = null
Return values
true

join()

JOIN句を生成する

protected join([Dsn|null $dsn = null ]) : array{sql: string, params: list|array}
Parameters
$dsn : Dsn|null = null
Return values
array{sql: string, params: list|array}

        
On this page

Search results