-
Notifications
You must be signed in to change notification settings - Fork 3
Example: Group list (groups.xml)
Chris edited this page Feb 15, 2017
·
2 revisions
DEPRECATED!
This wiki page has been deprecated and refers to version
1.0of the project. Please refer to the mainREADMEfor the latest documentation.
The parser implementation (pandaac\Exporter\Parsers\Groups in this case) has no options.
use pandaac\Exporter\Exporter;
use pandaac\Exporter\Parsers\Groups;
try {
$groups = new Exporter(
'./data/XML/groups.xml',
new Groups
);
$response = $groups->export();
} catch (Exception $e) {
// Log errors...
}The export() method returns a Illuminate\Support\Collection object, please refer to its documentation. If you would prefer a JSON or an array response however, you may do as follows...
$response = $groups->export()->toJson();$response = $groups->export()->toArray();[
{
"id": 1,
"name": "player",
"flags": 0,
"access": 0,
"maxdepotitems": 0,
"maxvipentries": 0
},
{
"id": 2,
"name": "gamemaster",
"flags": 137438953471,
"access": 1,
"maxdepotitems": 0,
"maxvipentries": 200
},
{
"id": 3,
"name": "god",
"flags": 272730398714,
"access": 1,
"maxdepotitems": 0,
"maxvipentries": 200
},
...
]