Свойство | Type | Description | |
---|---|---|---|
$keys | Relation keys names | ||
$relationType | string | Current relation type | |
$relations | array | All relations types | |
$tables | Tables names |
Méthode | Description | |
---|---|---|
belongsTo ( string $table ) : |
Set relation one2many to table | |
build ( array $array, string $part ) : array | ||
foreignKey ( string $key ) : |
Set foreign key name | |
getJunction ( ) : boolean | string | Getter of junction table name in many2many relation | |
getRelation ( ) : array | Get relation information | |
hasAndBelongsToMany ( string $table ) : |
Set relation many2many to table | |
hasMany ( string $table ) : |
Set relation many2one to table | |
localKey ( string $key ) : |
Set local key name | |
relations ( ) : array | Get relations types | |
removeRelation ( ) | Remove relation | |
setRelation ( ) | Set specified relation | |
table ( string $name ) : Lazer\Classes\Relation | Factory method | |
with ( string $table ) : |
Use relation to table |
Méthode | Description | |
---|---|---|
addRelation ( ) | Add data to configs and create all necessary files | |
deleteRelationData ( string $from, string $to ) | Inserts relation data to config file | |
insertRelationData ( string $from, string $to, string $type, array $keys ) | Inserts relation data to config file | |
join ( object $row ) : Lazer\Classes\Database | Process query with joined data | |
setKey ( string $type, string $key ) : |
Set key name | |
setRelationType ( string $relation ) | Set relation type to field | |
setTable ( string $type, string $name ) | Set table name |
protected addRelation ( ) |
protected deleteRelationData ( string $from, string $to ) | ||
$from | string | Local table |
$to | string | Related table |
public foreignKey ( string $key ) : |
||
$key | string | key name |
Résultat |
public getJunction ( ) : boolean | string | ||
Résultat | boolean | string | Name of junction table or false |
public getRelation ( ) : array | ||
Résultat | array | relation information |
public hasAndBelongsToMany ( string $table ) : |
||
$table | string | Table name |
Résultat |
protected setRelationType ( string $relation ) | ||
$relation | string | Name of relation |
protected string $relationType | ||
Résultat | string |
protected static array $relations | ||
Résultat | array |