PHP Interface Spatie\EloquentSortable\Sortable

Afficher le fichier Open project: spatie/eloquent-sortable

Méthodes publiques

Méthode Description
scopeOrdered ( Builder $query ) : Builder Let's be nice and provide an ordered scope.
setHighestOrderNumber ( ) Modify the order column value.
setNewOrder ( array | ArrayAccess $ids, integer $startOrder = 1 ) This function reorders the records: the record with the first id in the array will get order 1, the record with the second it will get order 2,.
shouldSortWhenCreating ( ) : boolean Determine if the order column should be set when saving a new model instance.

Method Details

scopeOrdered() public méthode

Let's be nice and provide an ordered scope.
public scopeOrdered ( Builder $query ) : Builder
$query Illuminate\Database\Eloquent\Builder
Résultat Illuminate\Database\Query\Builder

setHighestOrderNumber() public méthode

Modify the order column value.

setNewOrder() public static méthode

..
public static setNewOrder ( array | ArrayAccess $ids, integer $startOrder = 1 )
$ids array | ArrayAccess
$startOrder integer

shouldSortWhenCreating() public méthode

Determine if the order column should be set when saving a new model instance.
public shouldSortWhenCreating ( ) : boolean
Résultat boolean