/** * Return the model on which the method will be called * @param Tag $tag * @return Struct|Method */ protected function getModel(Tag $tag) { switch ($tag->getName()) { case WsdlDocument::TAG_OPERATION: $model = $this->getMethodByName($tag->getAttributeName()); break; default: $model = $this->getStructByName($tag->getAttributeName()); break; } return $model; }
/** * @param Tag $tag */ public function parseTag(Tag $tag) { $parent = $tag->getSuitableParent(); if ($parent instanceof Tag) { $model = $this->getModel($parent); if ($model instanceof Struct) { if ($tag->hasAttributeName() && ($modelAttribute = $model->getAttribute($tag->getAttributeName())) instanceof StructAttribute) { return $this->parseTagAttributes($tag, $model, $modelAttribute); } $this->parseTagAttributes($tag, $model); } } $this->parseTagAttributes($tag); }
/** * @param Tag $tag * @param Tag $child * @return TagRestriction */ private function parseRestrictionChild(Tag $tag, Tag $child) { if ($child->hasAttributeValue() && ($model = $this->getModel($tag)) instanceof Struct) { $model->addMeta($child->getName(), $child->getValueAttributeValue(true)); } else { foreach ($child->getAttributes() as $attribute) { $this->parseRestrictionChildAttribute($tag, $child, $attribute); } } return $this; }
/** * @see \WsdlToPhp\PackageGenerator\DomHandler\Wsdl\Tag\AbstractTag::getSuitableParentTags() */ public function getSuitableParentTags(array $additionalTags = array()) { return parent::getSuitableParentTags(array_merge($additionalTags, array(WsdlDocument::TAG_OPERATION))); }
/** * @param Tag $tag * @param Tag $child */ private function parseRestrictionChild(Tag $tag, Tag $child) { if ($child->hasAttributeValue() && ($model = $this->getModel($tag)) instanceof Struct) { $model->addMeta($child->getName(), $child->getValueAttributeValue(true)); } }