Quota
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.
at line 120
string
__toString()
No description
at line 107
bool
can_allocate(int $filesize, string $unit = 'MB')
Returns whether the given filesize can be allocated.
at line 93
int
convert_unit(int $size, int $from, int $to)
Converts and returns the given size from one unit to other.
at line 67
int
get_percent()
Return the percent number.
at line 58
int
get_size(string $unit = 'MB')
Returns the quota size.
Possible units are B, KB, MB, GB
at line 46
int
get_used(string $unit = 'MB')
Returns the used size.
Possible units are B, KB, MB, GB