WsdlToPhp\PackageGenerator\Model\StructAttribute::getSetterName PHP Method

getSetterName() public method

Returns the getter name for this attribute
public getSetterName ( ) : string
return string
    public function getSetterName()
    {
        return $this->replaceReservedMethod(sprintf('set%s', ucfirst(self::getUniqueName())), $this->getOwner()->getPackagedName());
    }

Usage Example

Example #1
0
 /**
  * @param PhpAnnotationBlock $annotationBlock
  * @param StructAttributeModel $attribute
  * @return Struct
  */
 protected function addStructMethodsGetAnnotationBlockFromXmlAttribute(PhpAnnotationBlock $annotationBlock, StructAttributeModel $attribute)
 {
     if ($attribute->isXml()) {
         $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, '\\DOMDocument::loadXML()'))->addChild(new PhpAnnotation(self::ANNOTATION_USES, '\\DOMDocument::hasChildNodes()'))->addChild(new PhpAnnotation(self::ANNOTATION_USES, '\\DOMDocument::saveXML()'))->addChild(new PhpAnnotation(self::ANNOTATION_USES, '\\DOMNode::item()'))->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $this->getModel()->getPackagedName(true), $attribute->getSetterName())))->addChild(new PhpAnnotation(self::ANNOTATION_PARAM, 'bool $asString true: returns XML string, false: returns \\DOMDocument'));
     }
     return $this;
 }