class Quota

Class Quota

Properties

protected string $unit
protected int $size
protected int $used
protected int $percent

Methods

__construct(int $size, int $used, string $unit = 'MB')

Quota constructor.

string
__toString()

No description

bool
can_allocate(int $filesize, string $unit = 'MB')

Returns whether the given filesize can be allocated.

int
convert_unit(int $size, int $from, int $to)

Converts and returns the given size from one unit to other.

int
get_percent()

Return the percent number.

int
get_size(string $unit = 'MB')

Returns the quota size.

int
get_used(string $unit = 'MB')

Returns the used size.

Details

at line 31
__construct(int $size, int $used, string $unit = 'MB')

Quota constructor.

Parameters

int $size
int $used
string $unit

at line 120
string __toString()

No description

Return Value

string

at line 107
bool can_allocate(int $filesize, string $unit = 'MB')

Returns whether the given filesize can be allocated.

Parameters

int $filesize
string $unit

Return Value

bool

at line 93
int convert_unit(int $size, int $from, int $to)

Converts and returns the given size from one unit to other.

Parameters

int $size
int $from
int $to

Return Value

int

at line 67
int get_percent()

Return the percent number.

Return Value

int

at line 58
int get_size(string $unit = 'MB')

Returns the quota size.

Possible units are B, KB, MB, GB

Parameters

string $unit

Return Value

int

at line 46
int get_used(string $unit = 'MB')

Returns the used size.

Possible units are B, KB, MB, GB

Parameters

string $unit

Return Value

int