\mindpowered\englishauctionEnglishAuction

An Auction Library Timed auction starting at a low price and increasing until no more bids are made.

Also supports reserve price and automatic bidding.

Summary

Methods
Properties
Constants
__construct()
Create()
GetStart()
GetEnd()
HasStarted()
HasEnded()
Bid()
GetHighestBidder()
GetHighestBids()
GetNumberOfBids()
GetPriceIncrement()
GetReservePrice()
GetStartingPrice()
CalcTimeRemaining()
CalcMinimumBid()
GetAuctionsEnding()
GetAuctionsStarting()
GetOpenAuctions()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

EnglishAuction

Create()

Create(float  $start, float  $end, float  $startingPrice, float  $reservePrice, float  $priceIncrement) : string

Create a new auction

Parameters

float $start

start time of auction

float $end

end time of auction

float $startingPrice

starting price of auction

float $reservePrice

reserve price for the auction (0 = none)

float $priceIncrement

price increments for bids in the auction

Returns

string —

auctionId

GetStart()

GetStart(string  $auctionId) : float

Get the start of an auction Will return a timestamp in milliseconds

Parameters

string $auctionId

auction id

Returns

float —

start of auction

GetEnd()

GetEnd(string  $auctionId) : boolean

Check if auction has ended

Parameters

string $auctionId

auction id

Returns

boolean —

true if auction has ended, false otherwise

HasStarted()

HasStarted(string  $auctionId) : boolean

Check if an auction has started yet

Parameters

string $auctionId

auction id

Returns

boolean —

true if auction has started, false otherwise

HasEnded()

HasEnded(string  $auctionId) : boolean

Check if an auction has ended yet

Parameters

string $auctionId

auction id

Returns

boolean —

true if auction has ended, false otherwise

Bid()

Bid(string  $auctionId, string  $userId, float  $price) : void

Create a bid in an auction

Parameters

string $auctionId

auction id

string $userId

user id

float $price

price bud

GetHighestBidder()

GetHighestBidder(string  $auctionId) : mixed

Get the highest bidder in an auction

Parameters

string $auctionId

auction id

Returns

mixed

GetHighestBids()

GetHighestBids(string  $auctionId, float  $numBids) : array

Get the highest bids in an auction

Parameters

string $auctionId

auction id

float $numBids

max number of highest bids to return

Returns

array —

Highest bids for the specified auction

GetNumberOfBids()

GetNumberOfBids(string  $auctionId) : float

Get the number of bids in an auction

Parameters

string $auctionId

auction id

Returns

float —

Number of bids placed in the specified auction

GetPriceIncrement()

GetPriceIncrement(string  $auctionId) : float

Get the price increment for the specified auction

Parameters

string $auctionId

auction id

Returns

float —

Price increment

GetReservePrice()

GetReservePrice(string  $auctionId) : float

Get the reserve price for the specified auction

Parameters

string $auctionId

auction id

Returns

float —

Reserve price

GetStartingPrice()

GetStartingPrice(string  $auctionId) : float

Get the starting price for the specified auction

Parameters

string $auctionId

auction id

Returns

float —

Starting price

CalcTimeRemaining()

CalcTimeRemaining(string  $auctionId, float  $now) : float

Get the time remaining for the specified auction

Parameters

string $auctionId

auction id

float $now

current unix timestamp

Returns

float —

Time remaining in seconds

CalcMinimumBid()

CalcMinimumBid(string  $auctionId) : float

Get the minimum next bid for the specified auction

Parameters

string $auctionId

auction id

Returns

float —

Minimum bid price

GetAuctionsEnding()

GetAuctionsEnding(float  $endfrom, float  $endto, float  $page, float  $perpage, string  $sort, boolean  $asc) : array

Get a list of auctions based on their end time

Parameters

float $endfrom

end from

float $endto

end to

float $page
float $perpage

number of auctions per page

string $sort

field to sort by

boolean $asc

ascending (true) or descending (false)

Returns

array —

List of auctions ending in the specified period

GetAuctionsStarting()

GetAuctionsStarting(float  $startfrom, float  $startto, float  $page, float  $perpage, string  $sort, boolean  $asc) : array

Get a list of auctions based on their start time

Parameters

float $startfrom

start from

float $startto

start to

float $page
float $perpage

number of auctions per page

string $sort

field to sort by

boolean $asc

ascending (true) or descending (false)

Returns

array —

List of auctions starting in the specified period

GetOpenAuctions()

GetOpenAuctions(float  $page, float  $perpage, string  $sort, boolean  $asc) : array

Get a list of currently running auctions

Parameters

float $page
float $perpage

number of auctions per page

string $sort

field to sort by

boolean $asc

ascending (true) or descending (false)

Returns

array —

List of open auctions