PHP Class Owl\Repositories\Eloquent\StockRepository

Inheritance: implements Owl\Repositories\StockRepositoryInterface
Show file Open project: owl/owl

Protected Properties

Property Type Description
$stock

Public Methods

Method Description
__construct ( Stock $stock )
destroy ( $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".
getRankingStockList ( $limit, $day_period = null ) : array Get ranking 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 method

public __construct ( Stock $stock )
$stock Owl\Repositories\Eloquent\Models\Stock

destroy() public method

Delete a "Stock data".
public destroy ( $user_id, $item_id ) : boolean
$user_id int user_id
$item_id int item_id
return boolean

firstOrCreate() public method

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
return Illuminate\Database\Eloquent\Model

getByItemId() public method

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

getByUserIdAndItemId() public method

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

getRankingStockList() public method

Get ranking data.
public getRankingStockList ( $limit, $day_period = null ) : array
$limit int limit date
$day_period int day period
return array

getRankingWithCache() public method

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

getRecentRankingWithCache() public method

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

getStockList() public method

Get stock lists.
public getStockList ( $user_id ) : array
$user_id int user_id
return array

Property Details

$stock protected property

protected $stock