class GiftCard

Class GiftCard

Properties

protected int $id
protected User $createdBy Which user purchased gift card
protected DateTime $createdAt DateTime when was gift car purchased
protected string $code Code of gift card
protected bool $used Is gift card used
protected float $amount Amount of gift card
protected string $currency Currency of gift card

Methods

__construct()

GiftCard constructor.

int
getId()

No description

setId(int $id)

No description

getCreatedBy()

No description

setCreatedBy(User $createdBy)

No description

getCreatedAt()

No description

setCreatedAt(DateTime $createdAt)

No description

string
getCode()

No description

setCode(string $code)

No description

string
generateCode(int $length = 30)

Generate unique code for gift card

boolean
isUsed()

No description

setUsed(boolean $used)

No description

int
getAmount()

No description

setAmount(int $amount)

No description

string
getCurrency()

No description

setCurrency(string $currency)

No description

Details

at line 107
__construct()

GiftCard constructor.

Initialize created at

at line 115
int getId()

Return Value

int

at line 125
GiftCard setId(int $id)

Parameters

int $id

Return Value

GiftCard

at line 135
User getCreatedBy()

Return Value

User

at line 145
GiftCard setCreatedBy(User $createdBy)

Parameters

User $createdBy

Return Value

GiftCard

at line 155
DateTime getCreatedAt()

Return Value

DateTime

at line 165
GiftCard setCreatedAt(DateTime $createdAt)

Parameters

DateTime $createdAt

Return Value

GiftCard

at line 175
string getCode()

Return Value

string

at line 185
GiftCard setCode(string $code)

Parameters

string $code

Return Value

GiftCard

at line 199
string generateCode(int $length = 30)

Generate unique code for gift card

Parameters

int $length
  • length of code

Return Value

string

at line 217
boolean isUsed()

Return Value

boolean

at line 227
GiftCard setUsed(boolean $used)

Parameters

boolean $used

Return Value

GiftCard

at line 237
int getAmount()

Return Value

int

at line 247
GiftCard setAmount(int $amount)

Parameters

int $amount

Return Value

GiftCard

at line 257
string getCurrency()

Return Value

string

at line 267
GiftCard setCurrency(string $currency)

Parameters

string $currency

Return Value

GiftCard