abstract class AbstractParser
Base class for all parsers.
A parser converts data from and to an associative array.
Methods
mixed |
fromArray(array $array)
Converts data from an associative array to the parser format. |
|
array |
toArray(mixed $data)
Converts data from the parser format to an associative array. |
|
listFromArray($data) | ||
listToArray($data) | ||
string |
load(string $path)
Loads data from a file. |
|
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given |
||
static AbstractParser |
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser |
Details
at line 31
abstract public mixed
fromArray(array $array)
Converts data from an associative array to the parser format.
Override in the parser driver.
at line 41
abstract public array
toArray(mixed $data)
Converts data from the parser format to an associative array.
Override in the parser driver.
at line 43
public
listFromArray($data)
at line 48
public
listToArray($data)
at line 60
public string
load(string $path)
Loads data from a file.
Executes PHP code blocks in the file.
at line 79
public
dump(string $data, string $path = null)
Dumps data to a file, or to STDOUT if no filename is given
at line 95
static public AbstractParser
getParser(string $type = 'XML')
Factory for getting an instance of a subclass of AbstractParser