Trait schmunk42\giiant\generators\crud\ModelTrait

Implemented byschmunk42\giiant\generators\crud\Generator

Method Details

createRelationRoute() public method

public void createRelationRoute ( $relation, $action )
$relation
$action
generateRelationTo() public method

public void generateRelationTo ( $relation )
$relation
getColumnByAttribute() public method

public void getColumnByAttribute ( $attribute, $model null )
$attribute
$model
getModelByTableName() public method

public void getModelByTableName ( $name )
$name
getModelNameAttribute() public method

public void getModelNameAttribute ( $modelClass )
$modelClass
getModelRelations() public method

Finds relations of a model class.

return values can be filtered by types 'belongs_to', 'many_many', 'has_many', 'has_one', 'pivot'

public array getModelRelations ( $modelClass, $types = ['belongs_to''many_many''has_many''has_one''pivot'] )
$modelClass \schmunk42\giiant\generators\crud\ActiveRecord
$types array
getRelationByColumn() public method

public null|\yii\db\ActiveQuery getRelationByColumn ( $model, $column )
$model
$column
isPivotRelation() public method

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