WsdlToPhp\PackageGenerator\Model\Struct::isArray PHP Method

isArray() public method

Returns true if the current struct is a collection of values (like an array)
public isArray ( ) : boolean
return boolean
    public function isArray()
    {
        return ($this->getIsStruct() && $this->countOwnAttributes() === 1 || !$this->getIsStruct() && $this->countOwnAttributes() <= 1) && stripos($this->getName(), 'array') !== false;
    }

Usage Example

 /**
  * @param StructModel $struct
  * @return StructEnumFile|StructArrayFile|StructFile
  */
 private function getStructFile(StructModel $struct)
 {
     if ($struct->getisRestriction()) {
         $file = new StructEnumFile($this->generator, $struct->getPackagedName());
     } elseif ($struct->isArray()) {
         $file = new StructArrayFile($this->generator, $struct->getPackagedName());
     } else {
         $file = new StructFile($this->generator, $struct->getPackagedName());
     }
     return $file;
 }