\Pop\DataData

Data class

Summary

Methods
Properties
Constants
__construct()
getData()
getString()
getType()
setData()
setString()
serialize()
unserialize()
convert()
outputToHttp()
writeToFile()
No public properties found
No constants found
autoDetect()
$type
$data
$string
N/A
No private methods found
No private properties found
N/A

Properties

$type

$type : string

Data file type

Type

string

$data

$data : mixed

Data in PHP

Type

mixed

$string

$string : string

Data as string

Type

string

Methods

__construct()

__construct(mixed  $data) : \Pop\Data\Data

Constructor

Instantiate the data object.

Parameters

mixed $data

Throws

\Pop\Data\Exception

Returns

\Pop\Data\Data

getData()

getData() : mixed

Get the data

Returns

mixed

getString()

getString() : string

Get the string

Returns

string

getType()

getType() : string

Get the type

Returns

string

setData()

setData(mixed  $data) : \Pop\Data\Data

Set the data

Parameters

mixed $data

Returns

\Pop\Data\Data

setString()

setString(string  $string) : \Pop\Data\Data

Set the string

Parameters

string $string

Returns

\Pop\Data\Data

serialize()

serialize(string  $to, array  $options = array()) : string

Serialize the data to a string

Parameters

string $to
array $options

Throws

\Pop\Data\Exception

Returns

string

unserialize()

unserialize(array  $options = array()) : mixed

Unserialize the string to data

Parameters

array $options

Throws

\Pop\Data\Exception

Returns

mixed

convert()

convert(string  $to, array  $options = array()) : string

Convert the current string data type to a string of a different data type

Parameters

string $to
array $options

Returns

string

outputToHttp()

outputToHttp(string  $filename = null, boolean  $forceDownload = true) : string

Output the data file directly.

Parameters

string $filename
boolean $forceDownload

Throws

\Pop\Data\Exception

Returns

string

writeToFile()

writeToFile(string  $to) : void

Save the data file to disk.

Parameters

string $to

Throws

\Pop\Data\Exception

autoDetect()

autoDetect() : \Pop\Data\Data

Auto-detect the data type from the string

Returns

\Pop\Data\Data