class SizeAccessors extends AbstractAccessors

Provides size object for {see StorageObjectInterface}.

Constants

SIZE_AUTO

SIZE_B

SIZE_KB

SIZE_MB

SIZE_GB

SIZE_TB

SIZE_PB

SIZE_EB

SIZE_YB

Methods

__construct( StorageObjectProviderInterface $provider)

Construct using object provider instance.

string
__toString()

Returns size as a human readable string {see StorageObjectSize::getString()}.

float
toInteger( string $unit = self::SIZE_B, int $precision = 4)

Returns the size as bytes.

string
toString( string $unit = self::SIZE_AUTO, int $precision = 4)

Returns the size as a human readable string.

Details

in AbstractAccessors at line line 31
final __construct( StorageObjectProviderInterface $provider)

Construct using object provider instance.

Parameters

StorageObjectProviderInterface $provider

at line line 34
string __toString()

Returns size as a human readable string {see StorageObjectSize::getString()}.

Return Value

string

at line line 47
float toInteger( string $unit = self::SIZE_B, int $precision = 4)

Returns the size as bytes.

Parameters

string $unit
int $precision

Return Value

float

at line line 62
string toString( string $unit = self::SIZE_AUTO, int $precision = 4)

Returns the size as a human readable string.

Parameters

string $unit
int $precision

Return Value

string