Created
February 17, 2018 00:54
-
-
Save zabaala/d40f289652e64c999e110496980c4bf8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//... | |
class DbCouponRepository implements CouponRepositoryInterface | |
{ | |
/** | |
* @const int | |
*/ | |
const PAGE_SIZE = 25; | |
/** | |
* @var CouponEloquentModel | |
*/ | |
private $model; | |
/** | |
* CouponRepository constructor. | |
*/ | |
public function __construct() | |
{ | |
$this->model = new CouponEloquentModel(); | |
} | |
/** | |
* Get all coupons. | |
* | |
* @param null $filterableKeyword | |
* @param array $orders | |
* @return LengthAwarePaginator | |
*/ | |
public function getAllCoupons( | |
$filterableKeyword = null, | |
array $orders = [ | |
[ | |
'column' => 'name', | |
'direction' => 'asc' | |
] | |
] | |
) | |
{ | |
return (new FetchAllCouponsMethodObject( | |
$this->model, | |
$filterableKeyword, | |
$orders, | |
self::PAGE_SIZE) | |
)->handle(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment