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

getGetterName() public method

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

Usage Example

Example #1
0
 /**
  * @param MethodContainer $methods
  * @param StructAttributeModel $attribute
  * @return Struct
  */
 protected function addStructMethodGet(MethodContainer $methods, StructAttributeModel $attribute)
 {
     $method = new PhpMethod($attribute->getGetterName(), $this->getStructMethodGetParameters($attribute));
     if ($attribute->nameIsClean()) {
         $thisAccess = sprintf('%s', $attribute->getName());
     } else {
         $thisAccess = sprintf('{\'%s\'}', addslashes($attribute->getName()));
     }
     $this->addStructMethodGetBody($method, $attribute, $thisAccess);
     $methods->add($method);
     return $this;
 }