JoinContract
Table of Contents
Properties
- $defaultJoinType : JoinType
- $joinAliases : array<string|int, mixed>|null
- $joins : array<string|int, mixed>|null
- $joinTypes : array<string|int, mixed>|null
Methods
- attachJoins() : Join
- Attaches all defined joins to the base query.
- getAllItemsJoined() : array<string|int, mixed>
- Will be used when we are listing everything.
- getOneJoined() : object|null
- Will be used when we are getting a single item.
- joinQuery() : Join
- Resolve the base query to base on to start joining.
- switchJoin() : Join
- weShouldJoin() : bool
- Detects whether to enter to enter the join mode or stay in the normal mode.
Properties
$defaultJoinType
public
JoinType
$defaultJoinType
= \Pionia\Http\Services\JoinType::INNER
The default join type to use when joining tables.
$joinAliases
public
array<string|int, mixed>|null
$joinAliases
= null
An associative array of aliases to be used for joins with the table in the service. The key is the table name and the value is the alias.
Tags
$joins
public
array<string|int, mixed>|null
$joins
= null
An associative array of tables to be used for joins with the table in the service. The key is the table name and the value is an array of the columns to join on.
Tags
$joinTypes
public
array<string|int, mixed>|null
$joinTypes
= null
An associative array of join types to be used for joins with the table in the service. The key is the table name and the value is the join type.
Tags
Methods
attachJoins()
Attaches all defined joins to the base query.
private
attachJoins([Join|null $join = null ]) : Join
Parameters
- $join : Join|null = null
Tags
Return values
JoingetAllItemsJoined()
Will be used when we are listing everything.
private
getAllItemsJoined() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getOneJoined()
Will be used when we are getting a single item.
private
getOneJoined() : object|null
Tags
Return values
object|nulljoinQuery()
Resolve the base query to base on to start joining.
private
joinQuery() : Join
If the developer has not yet defined any joins, we drop it and generate a new one.
Tags
Return values
JoinswitchJoin()
private
switchJoin(JoinType $joinType, Join $query, string $table) : Join
Parameters
- $joinType : JoinType
-
The type of join to use
- $query : Join
-
The current query we are joining to
- $table : string
-
The table to join
Return values
Join —The query with the join added
weShouldJoin()
Detects whether to enter to enter the join mode or stay in the normal mode.
private
weShouldJoin() : bool
Normal mode queries one table at a time.