GoodCode
class GoodCode (View source)
This class makes a set code, option code and so on.
Methods
__construct(string $code, GoodCodeType $originType)
Constructor.
string
code()
Gets the code
property
GoodCodeType
originalType()
Gets the originalType
property
GoodCodeType
type()
Gets the type
property
int|string|array
value()
Output value for good code.
static int
getId(string $code)
Get ID from GIF and COM codes.
Details
__construct(string $code, GoodCodeType $originType)
Constructor.
string
code()
Gets the code
property
GoodCodeType
originalType()
Gets the originalType
property
GoodCodeType
type()
Gets the type
property
int|string|array
value()
Output value for good code.
If the code is set code, it will be array of good values. If the code is normal code, it will be good code string. the code shouldn't be option, complex and gift code.
static int
getId(string $code)
Get ID from GIF and COM codes.
static GoodCode
of(string $code, string|null $option = null, callable|null $callback = null)
Create GoodCode instance from given code string and callback function
static GoodCode
setCodeOf(array $setCodes)
Make SetCode from key-value set code array.