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

getRemovableFromRequest() public method

    public function getRemovableFromRequest()
    {
        return $this->removableFromRequest;
    }

Usage Example

Beispiel #1
0
 /**
  * @param string $setOrGet
  * @param PhpAnnotationBlock $annotationBlock
  * @param StructAttributeModel $attribute
  * @return Struct
  */
 protected function addStructMethodsSetAndGetAnnotationBlockFromStructAttribute($setOrGet, PhpAnnotationBlock $annotationBlock, StructAttributeModel $attribute)
 {
     switch ($setOrGet) {
         case 'set':
             if ($attribute->getRemovableFromRequest()) {
                 $annotationBlock->addChild('This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object');
             }
             if (($model = $this->getRestrictionFromStructAttribute($attribute)) instanceof StructModel && !$this->getModel()->isArray()) {
                 $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $model->getPackagedName(true), StructEnum::METHOD_VALUE_IS_VALID)))->addChild(new PhpAnnotation(self::ANNOTATION_USES, sprintf('%s::%s()', $model->getPackagedName(true), StructEnum::METHOD_GET_VALID_VALUES)))->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, '\\InvalidArgumentException'));
             } elseif ($attribute->isArray()) {
                 $annotationBlock->addChild(new PhpAnnotation(self::ANNOTATION_THROWS, '\\InvalidArgumentException'));
             }
             $this->addStructMethodsSetAnnotationBlock($annotationBlock, $this->getStructAttributeTypeSetAnnotation($attribute), lcfirst($attribute->getCleanName()));
             break;
         case 'get':
             if ($attribute->getRemovableFromRequest()) {
                 $annotationBlock->addChild('An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0)');
             }
             $this->addStructMethodsGetAnnotationBlockFromXmlAttribute($annotationBlock, $attribute)->addStructMethodsGetAnnotationBlock($annotationBlock, $this->getStructAttributeTypeGetAnnotation($attribute));
             break;
     }
     return $this;
 }