Completed
Push — master ( f066c0...72d72a )
by Yaro
01:50 queued 10s
created

OrderByHandlerTrait::init()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 1
1
<?php
2
3
namespace Yaro\Jarboe\Http\Controllers\Traits\Handlers;
4
5
use Yaro\Jarboe\Table\CRUD;
6
7
trait OrderByHandlerTrait
8
{
9
    /**
10
     * Save direction by column.
11
     *
12
     * @param $column
13
     * @param $direction
14
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
15
     */
16 1
    public function orderBy($column, $direction)
17
    {
18 1
        $this->crud()->saveOrderFilterParam($column, $direction);
19
20 1
        return redirect($this->crud()->listUrl());
21
    }
22
23
    abstract protected function init();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
24
    abstract protected function bound();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
25
    abstract protected function crud(): CRUD;
26
    abstract protected function can($action): bool;
27
}
28