Propel API
Class

PropelYAMLParser

class PropelYAMLParser extends PropelParser

YAML parser.

Converts data between associative array and YAML formats

Methods

string fromArray(array $array)

Converts data from an associative array to YAML.

array toArray(string $data)

Converts data from YAML to an associative array.

listFromArray($data)

from PropelParser
listToArray($data)

from PropelParser
string load(string $path)

Loads data from a file.

from PropelParser
dump(string $data, string $path = null)

Dumps data to a file, or to STDOUT if no filename is given

from PropelParser
static PropelParser getParser(string $type = 'XML')

Factory for getting an instance of a subclass of PropelParser

from PropelParser
string toYAML(array $array)

Alias for PropelYAMLParser::fromArray()

array fromYAML(string $data)

Alias for PropelYAMLParser::toArray()

Details

at line 30
public string fromArray(array $array)

Converts data from an associative array to YAML.

Parameters

array $array Source data to convert

Return Value

string Converted data, as a YAML string

at line 52
public array toArray(string $data)

Converts data from YAML to an associative array.

Parameters

string $data Source data to convert, as a YAML string

Return Value

array Converted data

in PropelParser at line 40
public listFromArray($data)

Parameters

$data

in PropelParser at line 45
public listToArray($data)

Parameters

$data

in PropelParser at line 57
public string load(string $path)

Loads data from a file.

Executes PHP code blocks in the file.

Parameters

string $path Path to the file to load

Return Value

string The file content processed by PHP

in PropelParser at line 75
public dump(string $data, string $path = null)

Dumps data to a file, or to STDOUT if no filename is given

Parameters

string $data The file content
string $path Path of the file to create

in PropelParser at line 91
static public PropelParser getParser(string $type = 'XML')

Factory for getting an instance of a subclass of PropelParser

Parameters

string $type Parser type, amon 'XML', 'YAML', 'JSON', and 'CSV'

Return Value

PropelParser A PropelParser subclass instance

at line 41
public string toYAML(array $array)

Alias for PropelYAMLParser::fromArray()

Parameters

array $array Source data to convert

Return Value

string Converted data, as a YAML string

at line 63
public array fromYAML(string $data)

Alias for PropelYAMLParser::toArray()

Parameters

string $data Source data to convert, as a YAML string

Return Value

array Converted data