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. |
|
Описание методов
__construct()
публичный Метод
default constructor. Will copy argument into properties.
public add ( $object, $defaults = [] ) |
addField()
публичный Метод
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()
публичный Метод
afterUnload()
публичный Метод
containsMany()
публичный Метод
wrapper for containsMany that will associate field
with join.
containsOne()
публичный Метод
wrapper for containsOne that will associate field
with join.
getDesiredName()
публичный Метод
Will use either foreign_alias or create #join_.
hasMany()
публичный Метод
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()
публичный Метод
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 = [] ) |
leftJoin()
публичный Метод
public leftJoin ( $foreign_table, $defaults = [] ) |
public set ( $field, $value ) |
weakJoin()
публичный Метод
weakJoin will be attached to a current join.
weakJoinModel()
публичный Метод
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.
$id_field защищенное свойство
When deleting record, this field will be conditioned.
->where($join->id_field, $join->id)->delete();
$join защищенное свойство
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.
$prefix защищенное свойство
When $prefix is set, then all the fields generated through
our wrappers will be automatically prefixed inside the model.
$reverse защищенное свойство
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.
$weak защищенное свойство
Is our join weak? Weak join will stop you from touching foreign table.
|