PHP Class Owl\Services\StockService

Inheritance: extends Service
Afficher le fichier Open project: owl/owl

Protected Properties

Свойство Type Description
$stockRepo

Méthodes publiques

Méthode Description
__construct ( Owl\Repositories\StockRepositoryInterface $stockRepo )
delete ( $user_id, $item_id ) : boolean Delete a "Stock data".
firstOrCreate ( $user_id, $item_id ) : Illuminate\Database\Eloquent\Model get "Stock data" or Store a "Stock data".
getByItemId ( $item_id ) : Illuminate\Database\Eloquent\Collection Get "Stock data".
getByUserIdAndItemId ( $user_id, $item_id ) : Illuminate\Database\Eloquent\Collection Get "Stock data".
getRankingWithCache ( $limit ) : array Get ranking data from cache.
getRecentRankingWithCache ( $limit, $dayPeriod ) : array Get recent ranking data from cache.
getStockList ( $user_id ) : array Get stock lists.

Method Details

__construct() public méthode

public __construct ( Owl\Repositories\StockRepositoryInterface $stockRepo )
$stockRepo Owl\Repositories\StockRepositoryInterface

delete() public méthode

Delete a "Stock data".
public delete ( $user_id, $item_id ) : boolean
$user_id int user_id
$item_id int item_id
Résultat boolean

firstOrCreate() public méthode

get "Stock data" or Store a "Stock data".
public firstOrCreate ( $user_id, $item_id ) : Illuminate\Database\Eloquent\Model
$user_id int user_id
$item_id int item_id
Résultat Illuminate\Database\Eloquent\Model

getByItemId() public méthode

Get "Stock data".
public getByItemId ( $item_id ) : Illuminate\Database\Eloquent\Collection
$item_id int item_id
Résultat Illuminate\Database\Eloquent\Collection | Illuminate\Database\Eloquent\Builder

getByUserIdAndItemId() public méthode

Get "Stock data".
public getByUserIdAndItemId ( $user_id, $item_id ) : Illuminate\Database\Eloquent\Collection
$user_id int user_id
$item_id int item_id
Résultat Illuminate\Database\Eloquent\Collection | Illuminate\Database\Eloquent\Builder

getRankingWithCache() public méthode

Get ranking data from cache.
public getRankingWithCache ( $limit ) : array
$limit int limit date
Résultat array

getRecentRankingWithCache() public méthode

Get recent ranking data from cache.
public getRecentRankingWithCache ( $limit, $dayPeriod ) : array
$limit int limit date
$dayPeriod int day period
Résultat array

getStockList() public méthode

Get stock lists.
public getStockList ( $user_id ) : array
$user_id int user_id
Résultat array

Property Details

$stockRepo protected_oe property

protected $stockRepo