wfs = $aWfs; } public function hasNamespace ($key, $value) { for ($i = 0; $i < count($this->namespaceArray); $i++) { if ($this->namespaceArray[$i]->name == $key && $this->namespaceArray[$i]->value == $value) { return true; } } return false; } public function getNamespace ($key) { for ($i = 0; $i < count($this->namespaceArray); $i++) { if ($this->namespaceArray[$i]->name == $key) { return $this->namespaceArray[$i]->value; } } return null; } public function addNamespace ($key, $value) { if ($this->hasNamespace($key, $value)) { return $this; } $newNamespace = new stdClass(); $newNamespace->name = $key; $newNamespace->value = $value; array_push($this->namespaceArray, $newNamespace); return $this; } public function addElement ($name, $type) { $newElement = new stdClass(); if (func_num_args() == 3) { $newElement->id = func_get_arg(2); } else { $newElement->id = null; } $newElement->name = $name; $newElement->type = $type; array_push($this->elementArray, $newElement); return $this; } public function toHtml () { $wfsString .= "
"; $wfsString .= "name: ". $this->name . "
"; $wfsString .= "title: ". $this->title . "
"; $wfsString .= "abstract: ". $this->summary . "
"; $wfsString .= "srs: ". $this->srs . "
"; for ($j = 0; $j < count($this->elementArray); $j++) { $currentElement = $this->elementArray[$j]; $wfsString .= " element: " . $currentElement->name . " - " . $currentElement->type . "
"; } for ($j = 0; $j < count($this->namespaceArray); $j++) { $currentNamespace = $this->namespaceArray[$j]; $wfsString .= " namespace: " . $currentNamespace->name . " - " . $currentNamespace->value . "
"; } return $wfsString; } public function __toString () { return $this->toHtml(); } } ?>