| 12345678910111213141516171819202122 |
- <?php
- function testFetchWfs($typeName, $featureId) {
- DBG::log([$typeName, $featureId], 'array', "TODO: testFetchWfs");
- $dom = new DOMDocument();
- $tmp = $dom->createDocumentFragment();
- try {
- $acl = ACL::getAclByTypeName($typeName);
- $pk = substr($featureId, strpos($featureId, '.') + 1);
- $item = $acl->buildQuery([])->getItem($pk);
- if (!$item) throw new Exception("Object with primary key = '{$pk}' not found");
- foreach ($item as $fieldName => $value) {
- $tmp->appendXML('<p>' . $fieldName .': "' . $value . '"</p>');
- }
- } catch (Exception $e) {
- $tmp->appendXML('<div class="alert alert-danger">' . $e->getMessage() . '</div>');
- }
- return $tmp; // TODO: require <xsl:copy-of select="php:function(...)/node() - @see https://en.wikibooks.org/wiki/PHP_Programming/XSL/registerPHPFunctions#XSL_receiving_external_fragments
- // return $dom->saveXML($tmp);
- }
|