| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- class Type_WpsProcess {
- var $_data = [];
- // Type_WpsProcessOutput: [ 'MimeType' => text/xml, 'Encoding' => base64, 'Schema' => http://foo.bar/gml/3.1.0/polygon.xsd ]
- // supportedOutput: [ Type_WpsProcessOutput, ... ]
- // [ 'MimeType' => "text/xml; subtype=wfs-collection/1.0" ],
- // [ 'MimeType' => "text/xml; subtype=wfs-collection/1.1" ],
- // [ 'MimeType' => "application/json" ],
- // [ 'MimeType' => "application/wfs-collection-1.0" ],
- // [ 'MimeType' => "application/wfs-collection-1.1" ],
- // [ 'MimeType' => "application/zip" ],
- static function build($conf) { // @return Type_WpsProcess
- $wpsProcess = new Type_WpsProcess();
- $wpsProcess->identifier = $conf['identifier'];
- $wpsProcess->title = $conf['title'];
- $wpsProcess->description = $conf['description'];
- $wpsProcess->maxOccurs = $conf['maxOccurs'];
- $wpsProcess->minOccurs = $conf['minOccurs'];
- $wpsProcess->dataInputs = array_map(function ($input) {
- // 'identifier' => $identifier,
- // 'title' => $title,
- // 'description' => $description,
- // 'type' => 'literal',
- return (object)$input;
- }, $conf['dataInputs']);
- $wpsProcess->defaultOutput = $conf['defaultOutput'];
- $wpsProcess->supportedOutput = $conf['supportedOutput'];
- return $wpsProcess;
- }
- function __isset($name) {
- return (array_key_exists($name, $this->_data));
- }
- function __get($name) {
- if (array_key_exists($name, $this->_data)) {
- return $this->_data[$name];
- }
- return null;
- }
- function __set($name, $value) {
- $this->_data[$name] = $value;
- }
- function toArray() {
- return $this->_data;
- }
- function __toString() {
- return str_replace('"', '',
- str_replace([ '{', '}', '":', ',"' ], [ '{ ', ' }', ': ', ', ' ], json_encode($this->_data))
- );
- }
- }
|