PHP Trait schmunk42\giiant\generators\crud\ModelTrait

Afficher le fichier Open project: schmunk42/yii2-giiant

Méthodes publiques

Méthode Description
createRelationRoute ( $relation, $action )
generateRelationTo ( $relation )
getColumnByAttribute ( $attribute, $model = null )
getModelByTableName ( $name )
getModelNameAttribute ( $modelClass )
getModelRelations ( ActiveRecord $modelClass, array $types = ['belongs_to', 'many_many', 'has_many', 'has_one', 'pivot'] ) : array Finds relations of a model class.
getRelationByColumn ( $model, $column ) : null | ActiveQuery
isPivotRelation ( ActiveQuery $relation )

Method Details

createRelationRoute() public méthode

public createRelationRoute ( $relation, $action )

generateRelationTo() public méthode

public generateRelationTo ( $relation )

getColumnByAttribute() public méthode

public getColumnByAttribute ( $attribute, $model = null )

getModelByTableName() public méthode

public getModelByTableName ( $name )

getModelNameAttribute() public méthode

public getModelNameAttribute ( $modelClass )

getModelRelations() public méthode

return values can be filtered by types 'belongs_to', 'many_many', 'has_many', 'has_one', 'pivot'
public getModelRelations ( ActiveRecord $modelClass, array $types = ['belongs_to', 'many_many', 'has_many', 'has_one', 'pivot'] ) : array
$modelClass ActiveRecord
$types array
Résultat array

getRelationByColumn() public méthode

public getRelationByColumn ( $model, $column ) : null | ActiveQuery
$column
Résultat null | yii\db\ActiveQuery

isPivotRelation() public méthode

public isPivotRelation ( ActiveQuery $relation )
$relation yii\db\ActiveQuery