Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
OpsPortal
lavoisiercli
Commits
ae894c35
Commit
ae894c35
authored
Oct 13, 2014
by
ZZZ[GONE] Lequeux Olivier
Browse files
simpleXML example
parent
d4412957
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
README.md
README.md
+29
-1
No files found.
README.md
View file @
ae894c35
...
...
@@ -6,5 +6,33 @@ Some basics hydrators are provided, but you will easily create your own.
## Requirements
>
>
PHP 5.3
> PHP 5.3
> enable cURL PHP extension
## Get Started
### Hydrate with SimpleXMLHydrator
```
$lquery = new \Lavoisier\Query('localhost','example');
$lquery->setPath("/data/products[@month='January']");
$lquery->setHydrator(new \Lavoisier\Hydrators\SimpleXMLHydrator());
$result = $lquery->execute();
object(SimpleXMLElement)#2 (1) {
["products"]=>
object(SimpleXMLElement)#4 (4) {
["@attributes"]=>
array(1) {
["month"]=>
string(7) "January"
}
["A"]=>
string(4) "8343"
["B"]=>
string(4) "2446"
["average"]=>
string(6) "5394.5"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment