Completed
Push — master ( 5c46bf...f77784 )
by Mahmoud
03:22
created

OrderByNameCriteria::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace App\Port\Criteria\Eloquent;
4
5
use App\Port\Criteria\Abstracts\Criteria;
6
use Prettus\Repository\Contracts\RepositoryInterface as PrettusRepositoryInterface;
7
8
/**
9
 * Class OrderByNameCriteria.
10
 *
11
 * @author  Mahmoud Zalt <[email protected]>
12
 */
13
class OrderByNameCriteria extends Criteria
14
{
15
16
    /**
17
     * @param                                                   $model
18
     * @param \Prettus\Repository\Contracts\RepositoryInterface $repository
19
     *
20
     * @return mixed
21
     */
22
    public function apply($model, PrettusRepositoryInterface $repository)
23
    {
24
        return $model->orderBy('name', 'asc');
25
    }
26
}
27