getStruct() public method

Gets the struct by its name
public getStruct ( string $structName ) : Struct | null
$structName string the original struct name
return WsdlToPhp\PackageGenerator\Model\Struct | null
コード例 #1
0
ファイル: Service.php プロジェクト: jzaeske/PackageGenerator
 /**
  * @param MethodModel $method
  * @return string
  */
 public static function getOperationMethodReturnType(MethodModel $method, Generator $generator)
 {
     $returnType = $method->getReturnType();
     if (($struct = $generator->getStruct($returnType)) instanceof StructModel && $struct->getIsStruct() && !$struct->getIsRestriction()) {
         $returnType = $struct->getPackagedName(true);
     }
     return $returnType;
 }
コード例 #2
0
 /**
  * @param MethodModel $method
  * @return string
  */
 public static function getOperationMethodReturnType(MethodModel $method, Generator $generator)
 {
     $returnType = $method->getReturnType();
     if (($struct = $generator->getStruct($returnType)) instanceof StructModel && !$struct->getIsRestriction()) {
         if ($struct->getIsStruct()) {
             $returnType = $struct->getPackagedName(true);
         } elseif ($struct->isArray()) {
             if (($structInheritance = $struct->getInheritanceStruct()) instanceof StructModel) {
                 $returnType = sprintf('%s[]', $structInheritance->getPackagedName(true));
             } else {
                 $returnType = $struct->getInheritance();
             }
         }
     }
     return $returnType;
 }