Menu

## Join extends ContractBuilder
in package
Uses JoinParseTrait, FilterTrait

Join.php : 27

Builds relationships across multiple tables.

### Table of Contents

#### Properties

$columns : mixed|string
$database : Core
$joins : array<string|int, mixed>
  List of all joins that are about to be applied.These are in a medoo format.
$preventLimit : bool
$table : string
$where : array<string|int, mixed>

#### Methods

__construct() : mixed
all() : array<string|int, mixed>|null
  Returns all items from the Database. If a callback is passed, it will be called on each item in the resultset
build() : Join
builder() : static
count() : int|null
full() : static
getJoins() : array<string|int, mixed>
  Returns the medoo-like join array that was generated after chaining multiple joins
group() : mixed
having() : $this
  Adds a 'having' clause to the query
inner() : static
left() : static
limit() : static
orderBy() : $this
  Orders the query by certain value.
right() : static
startAt() : static
where() : static
join() : static
runSelect() : array<string|int, mixed>|null

### Properties

#### $columns

Join.php : 39
`private mixed|string $columns`

#### $database

Join.php : 31
`private Core $database`

#### $joins

Join.php : 45

List of all joins that are about to be applied.These are in a medoo format.

`private array<string|int, mixed> $joins = []`

#### $preventLimit

Join.php : 33
`private bool $preventLimit = false`

#### $table

Join.php : 29
`private string $table`

#### $where

Join.php : 35
`private array<string|int, mixed> $where`

### Methods

#### __construct()

Join.php : 50
`public __construct(mixed $table, Core $database[, mixed $columns = "*" ][, mixed $where = [] ]) : mixed`

##### Parameters

$table : mixed
$database : Core
$columns : mixed = "*"
$where : mixed = []

#### all()

JoinParseTrait.php : 46

Returns all items from the Database. If a callback is passed, it will be called on each item in the resultset

`public all([callable|null $callback = null ]) : array<string|int, mixed>|null`

##### Parameters

$callback : callable|null = null

  This is the receiver for the current resultset

##### Tags

example

      // Assignment method
      $row = Table::from('user')
          ->filter(['last_name' => 'Ezra'])
         ->all();

      // Callback method- this is little bit faster than the assignment method
      Table::from('user')
         ->filter(['last_name' => 'Ezra'])
        ->all(function($row) {
           echo $row->first_name;
       });

##### Return values

array<string|int, mixed>|null

#### build()

Join.php : 67
`public build() : Join`

##### Return values

Join

#### builder()

ContractBuilder.php : 21
`public static builder(mixed ...$args) : static`

##### Parameters

$args : mixed

##### Return values

static

#### count()

Join.php : 78
`public count([string|null $column = "*" ][, array<string|int, mixed>|null $where = null ]) : int|null`

##### Parameters

$column : string|null = "*"
$where : array<string|int, mixed>|null = null

##### Tags

see
  Core::count()

##### Return values

int|null

#### full()

JoinParseTrait.php : 89
`public full(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static`

##### Parameters

$table : mixed
$on_or_using : string|array<string|int, mixed>
$alias : string|null = null

##### Return values

static

#### getJoins()

Join.php : 62

Returns the medoo-like join array that was generated after chaining multiple joins

`public getJoins() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### group()

FilterTrait.php : 63
`public group(string|array<string|int, mixed> $group) : mixed`

##### Parameters

$group : string|array<string|int, mixed>

#### having()

FilterTrait.php : 76

Adds a 'having' clause to the query

`public having(string $column, mixed $value[, string|null $needle = null ]) : $this`

##### Parameters

$column : string
$value : mixed
$needle : string|null = null

  can be >, <, !,>=, <=. >< and <> are available for datetime

##### Return values

$this

#### inner()

JoinParseTrait.php : 65
`public inner(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static`

##### Parameters

$table : mixed
$on_or_using : string|array<string|int, mixed>
$alias : string|null = null

##### Return values

static

#### left()

JoinParseTrait.php : 73
`public left(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static`

##### Parameters

$table : mixed
$on_or_using : string|array<string|int, mixed>
$alias : string|null = null

##### Return values

static

#### limit()

FilterTrait.php : 24
`public limit(int $limit) : static`

##### Parameters

$limit : int

##### Tags

throws
  Exception

##### Return values

static

#### orderBy()

FilterTrait.php : 106

Orders the query by certain value.

`public orderBy(string|array<string|int, mixed> $value) : $this`

##### Parameters

$value : string|array<string|int, mixed>

##### Tags

example

      // single column
      ->filter()
      ->orderBy("name")

      // multiple Order items
      ->filter()
      ->orderBy(['name' => 'DESC', 'age' => 'ASC'])

##### Return values

$this

#### right()

JoinParseTrait.php : 81
`public right(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static`

##### Parameters

$table : mixed
$on_or_using : string|array<string|int, mixed>
$alias : string|null = null

##### Return values

static

#### startAt()

FilterTrait.php : 46
`public startAt([int $startPoint = 0 ]) : static`

##### Parameters

$startPoint : int = 0

##### Return values

static

#### where()

JoinParseTrait.php : 51
`public where(array<string|int, mixed> $where) : static`

##### Parameters

$where : array<string|int, mixed>

##### Return values

static

#### join()

JoinParseTrait.php : 57
`private join(string $joinTable, string $alias, string|array<string|int, mixed> $on_or_using, string $joinType) : static`

##### Parameters

$joinTable : string
$alias : string
$on_or_using : string|array<string|int, mixed>
$joinType : string

##### Return values

static

#### runSelect()

JoinParseTrait.php : 22
`private runSelect(callable|null $callback) : array<string|int, mixed>|null`

##### Parameters

$callback : callable|null

##### Return values

array<string|int, mixed>|null

## Search results