getDesiredName ( ) |
Will use either foreign_alias or create #join_.
|
hasMany ( $model, $defaults = [] ) |
creates reference based on the field from the join. |
|
hasOne ( $model, $defaults = [] ) |
creates reference based on a field from the join. |
|
importModel ( $m, $defaults = [] ) |
Will iterate through this model by pulling
- fields
- references
- conditions. |
|
init ( ) |
|
|
join ( $foreign_table, $defaults = [] ) |
Join will be attached to a current join. |
|
leftJoin ( $foreign_table, $defaults = [] ) |
|
|
set ( $field, $value ) |
|
|
weakJoin ( $defaults = [] ) |
weakJoin will be attached to a current join. |
|
weakJoinModel ( $model, $fields = [] ) |
Joins with the primary table of the model and
then import all of the data into our model. |
|
Method Details
__construct()
public method
default constructor. Will copy argument into properties.
public add ( $object, $defaults = [] ) |
Adding field into join will automatically associate that field
with this join. That means it won't be loaded from $table, but
form the join instead.
addFields()
public method
afterUnload()
public method
containsMany()
public method
wrapper for containsMany that will associate field
with join.
containsOne()
public method
wrapper for containsOne that will associate field
with join.
getDesiredName()
public method
Will use either foreign_alias or create #join_.
creates reference based on the field from the join.
public hasMany ( $model, $defaults = [] ) |
creates reference based on a field from the join.
public hasOne ( $model, $defaults = [] ) |
importModel()
public method
and then will apply them locally. Any you think that any fields
could clash, then use ['prefix'=>'m2'] which will be pre-pended
to all the fields. Conditions will me automatically mapped.
Join will be attached to a current join.
public join ( $foreign_table, $defaults = [] ) |
public leftJoin ( $foreign_table, $defaults = [] ) |
public set ( $field, $value ) |
weakJoin will be attached to a current join.
weakJoinModel()
public method
Joins with the primary table of the model and
then import all of the data into our model.
Property Details
$foreign_field protected_oe property
Field to be used for matching in a foreign table. By default
it's 'id'.
$foreign_table protected_oe property
For SQL, This can also be an expression or sub-select.
$id protected_oe property
ID used by a joined table.
$id_field protected_oe property
When deleting record, this field will be conditioned.
->where($join->id_field, $join->id)->delete();
$join protected_oe property
When join is done on another join.
$master_field protected_oe property
Field to be used for matching inside master field. By default
it's $foreign_table.'_id'.
$persistence protected_oe property
If $persistence is set, then it's used for loading
and storing the values, instead $owner->persistence.
$prefix protected_oe property
When $prefix is set, then all the fields generated through
our wrappers will be automatically prefixed inside the model.
$reverse protected_oe property
If you are using the following syntax:
$user->join('contact','default_contact_id');
Then the ID connecting tables is stored in foreign table and the order
of saving and delete needs to be reversed. In this case $reverse
will be set to true. You can specify value of this property.
$save_buffer protected_oe property
Data which is populated here as the save/insert progresses.
$weak protected_oe property
Is our join weak? Weak join will stop you from touching foreign table.
|