Methods
Create XML mapper
__construct()
Create object from xml
fromXml(\Moneybird\SimpleXMLElement $xmlElement)
Create object from xml string
fromXmlString(string $xmlstring)
Parameters
$xmlstring
string
Exceptions
Map object
mapToStorage(\Moneybird\Mapper_Mapable $subject) : string
Parameters
Returns
string
Convert to XML string
toXMLString(\Moneybird\Mapper_Mapable $subject) : string
Parameters
Returns
string
Cast value based on type
castValue(\Moneybird\SimpleXMLElement $xmlElement) : mixed
Maps object to XML element-name
mapObjectToElementName(\Moneybird\Mapper_Mapable $subject) : string
Parameters
Returns
string
Write property as xml key
propertyToXmlkey(string $key) : string
Parameters
$key
string
Returns
string
Callback to rewrite property to xml key
propertyToXmlkeyCallback(Array $match) : string
Parameters
$match
Array
Returns
string
Compare length of $a with length of $b
sortKeyLength(string $a, string $b) : int
Parameters
$a
string
$b
string
Returns
int
Test if $str ends with $end
strEndsWith(string $str, string $end) : bool
Parameters
$str
string
$end
string
Returns
bool
Map XMLelement to classname
xmlElementToClassname(\Moneybird\SimpleXMLElement $xmlElement) : string
Parameters
Returns
string
Write xml key as property
xmlkeyToProperty(string $key) : string
Parameters
$key
string
Returns
string
Callback to rewrite xml key to property
xmlkeyToPropertyCallback(Array $match) : string
Parameters
$match
Array
Returns
string
Properties
Mapper for xml element names to class names
$objectMapper : Array