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. |
|
메소드 상세
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.
wrapper for containsMany that will associate field
with join.
wrapper for containsOne that will associate field
with join.
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 = [] ) |
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.
Joins with the primary table of the model and
then import all of the data into our model.
프로퍼티 상세
$foreign_field 보호되어 있는 프로퍼티
Field to be used for matching in a foreign table. By default
it's 'id'.
$foreign_table 보호되어 있는 프로퍼티
For SQL, This can also be an expression or sub-select.
ID used by a joined table.
When deleting record, this field will be conditioned.
->where($join->id_field, $join->id)->delete();
When join is done on another join.
$master_field 보호되어 있는 프로퍼티
Field to be used for matching inside master field. By default
it's $foreign_table.'_id'.
$persistence 보호되어 있는 프로퍼티
If $persistence is set, then it's used for loading
and storing the values, instead $owner->persistence.
When $prefix is set, then all the fields generated through
our wrappers will be automatically prefixed inside the model.
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 보호되어 있는 프로퍼티
Data which is populated here as the save/insert progresses.
Is our join weak? Weak join will stop you from touching foreign table.
|