PHP 트레잇 schmunk42\giiant\generators\crud\ModelTrait

파일 보기 프로젝트 열기: schmunk42/yii2-giiant

공개 메소드들

메소드 설명
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 )

메소드 상세

createRelationRoute() 공개 메소드

public createRelationRoute ( $relation, $action )

generateRelationTo() 공개 메소드

public generateRelationTo ( $relation )

getColumnByAttribute() 공개 메소드

public getColumnByAttribute ( $attribute, $model = null )

getModelByTableName() 공개 메소드

public getModelByTableName ( $name )

getModelNameAttribute() 공개 메소드

public getModelNameAttribute ( $modelClass )

getModelRelations() 공개 메소드

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
리턴 array

getRelationByColumn() 공개 메소드

public getRelationByColumn ( $model, $column ) : null | ActiveQuery
$column
리턴 null | yii\db\ActiveQuery

isPivotRelation() 공개 메소드

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