Devise\Support\Sortable\Sort::setDefaultOrderBy PHP Method

setDefaultOrderBy() public method

Sets the default value of defaultOrderBy
public setDefaultOrderBy ( string $field, string $dir = 'asc' ) : void
$field string
$dir string
return void
    public function setDefaultOrderBy($field, $dir = 'asc')
    {
        $this->defaultOrderBy = [$field, $dir];
    }

Usage Example

Exemplo n.º 1
0
 public function test_it_sets_default_order_by()
 {
     $Manager = m::mock('Devise\\Support\\Sortable\\Manager');
     $Framework = new \Devise\Support\Framework();
     $Sort = new Sort($Manager, $Framework);
     $Sort->setDefaultOrderBy('fieldname');
 }