class Struct extends AbstractModelFile (View source)

Constants

PHP_FILE_EXTENSION

ANNOTATION_META_LENGTH

ANNOTATION_LONG_LENGTH

ANNOTATION_PACKAGE

ANNOTATION_SUB_PACKAGE

ANNOTATION_RETURN

ANNOTATION_USES

ANNOTATION_PARAM

ANNOTATION_VAR

ANNOTATION_SEE

ANNOTATION_THROWS

METHOD_CONSTRUCT

METHOD_SET_STATE

TYPE_STRING

TYPE_ARRAY

Properties

protected Generator $generator from AbstractFile
protected PhpFile $file from AbstractFile
protected Method $methods from AbstractModelFile

Methods

__construct(Generator $generator, string $name)

No description

setGenerator(Generator $generator)

No description

getGenerator()

No description

void
write()

No description

void
writeFile(bool $withSrc = true)

No description

string
getFileName()

No description

string
getFileDestination(bool $withSrc = true)

No description

string
getFileExtension()

No description

setFile(PhpFile $file)

No description

PhpFile
getFile()

No description

string
getDestinationFolder(bool $withSrc = true)

No description

setModel(AbstractModel $model)

No description

getModel()

No description

Struct|null
getModelByName(string $name)

No description

definePackageAnnotations(PhpAnnotationBlock $block)

No description

string
getPackageName()

No description

defineGeneralAnnotations(PhpAnnotationBlock $block)

No description

PhpAnnotationBlock
getClassAnnotationBlock()

No description

string
getClassDeclarationLine()

No description

string
getClassDeclarationLineText()

No description

defineModelAnnotationsFromWsdl(PhpAnnotationBlock $block, AbstractModel $model = null)

No description

defineConstants(PhpClass $class)

No description

defineProperties(PhpClass $class)

No description

defineMethods(PhpClass $class)

No description

getClassConstants(Constant $constants)

No description

PhpAnnotationBlock|null
getConstantAnnotationBlock(PhpConstant $constant)

No description

getClassProperties(Property $properties)

No description

PhpAnnotationBlock|null
getPropertyAnnotationBlock(PhpProperty $property)

No description

void
fillClassMethods()

This method is responsible for filling in the $methods property with appropriate methods for the current model

PhpAnnotationBlock|null
getMethodAnnotationBlock(PhpMethod $method)

No description

defineStringMethod(PhpClass $class)

No description

PhpAnnotationBlock
PhpMethod
getToStringMethod()

No description

getStructAttribute(StructAttribute $attribute = null)

No description

Struct|null
getModelFromStructAttribute(StructAttribute $attribute = null)

No description

Struct|null
getRestrictionFromStructAttribute(StructAttribute $attribute = null)

No description

bool
isAttributeAList(StructAttribute $attribute = null)

No description

string
getStructAttributeType(StructAttribute $attribute = null, bool $namespaced = false)

No description

string
getStructAttributeTypeGetAnnotation(StructAttribute $attribute = null, bool $returnArrayType = true)

No description

string
getStructAttributeTypeSetAnnotation(StructAttribute $attribute = null, bool $returnArrayType = true)

No description

bool
useBrackets(StructAttribute $attribute, bool $returnArrayType = true)

No description

string
getStructAttributeTypeHint(StructAttribute $attribute = null, bool $returnArrayType = true)

No description

string
getStructAttributeTypeAsPhpType(StructAttribute $attribute = null)

No description

static mixed
getValidType($type, $xsdTypesPath = null, $fallback = null)

See http://php.net/manual/fr/language.oop5.typehinting.php for these cases Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp

static mixed
getPhpType($type, $xsdTypesPath = null, $fallback = self::TYPE_STRING)

See http://php.net/manual/fr/language.oop5.typehinting.php for these cases Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp

getModelAttributes(bool $includeInheritanceAttributes = false, bool $requiredFirst = true)

No description

addStructMethodConstruct()

No description

addStructMethodConstructBody(PhpMethod $method)

No description

addStructMethodConstructBodyForAttribute(PhpMethod $method, StructAttribute $attribute, bool $isLast)

No description

getStructMethodParameter(StructAttribute $attribute, bool $lowCaseFirstLetter = false, mixed $defaultValue = null)

No description

string|null
getStructMethodParameterType(StructAttribute $attribute, bool $returnArrayType = true)

No description

addStructMethodAddTo(StructAttribute $attribute)

No description

addStructMethodAddToBody(PhpMethod $method, StructAttribute $attribute)

No description

addStructMethodSet(StructAttribute $attribute)

No description

addStructMethodSetBody(PhpMethod $method, StructAttribute $attribute)

No description

addStructMethodSetBodyAssignment(PhpMethod $method, StructAttribute $attribute, string $parameterName)

No description

addStructMethodSetBodyReturn(PhpMethod $method)

No description

string
getStructMethodSetBodyAssignment(StructAttribute $attribute, string $parameterName)

No description

addStructMethodGetBody(PhpMethod $method, StructAttribute $attribute, string $thisAccess)

No description

addStructMethodGetBodyReturn(PhpMethod $method, StructAttribute $attribute, string $thisAccess)

No description

addStructMethodGet(StructAttribute $attribute)

No description

addStructMethodSetState()

No description

PhpAnnotationBlock|null
getStructMethodAnnotationBlock(PhpMethod $method)

No description

PhpAnnotationBlock
PhpAnnotationBlock
PhpAnnotationBlock
getStructMethodsSetAndGetAnnotationBlock(PhpMethod $method)

No description

addStructMethodsSetAndGetAnnotationBlockFromStructAttribute(string $setOrGet, PhpAnnotationBlock $annotationBlock, StructAttribute $attribute)

No description

addStructMethodsSetAndGetAnnotationBlockFromScalar(string $setOrGet, PhpAnnotationBlock $annotationBlock, string $attributeName)

No description

addStructMethodsSetAnnotationBlock(PhpAnnotationBlock $annotationBlock, string $type, string $name)

No description

addStructMethodsGetAnnotationBlock(PhpAnnotationBlock $annotationBlock, string $attributeType)

No description

addStructMethodsGetAnnotationBlockFromXmlAttribute(PhpAnnotationBlock $annotationBlock, StructAttribute $attribute)

No description

addStructPropertiesToAnnotationBlock(PhpAnnotationBlock $annotationBlock)

No description

addStructPropertiesToAnnotationBlockUses(PhpAnnotationBlock $annotationBlock)

No description

addStructPropertiesToAnnotationBlockParams(PhpAnnotationBlock $annotationBlock)

No description

PhpAnnotationBlock
getStructMethodsAddToAnnotationBlock(PhpMethod $method)

No description

PhpAnnotationBlock
getStructMethodsValidateArrayAnnotationBlock(PhpMethod $method)

No description

PhpAnnotationBlock
getStructMethodsValidateUnionAnnotationBlock(PhpMethod $method)

No description

PhpAnnotationBlock
getStructMethodsValidateChoiceAnnotationBlock(PhpMethod $method)

No description

PhpAnnotationBlock
getStructMethodsValidateLengthAnnotationBlock(PhpMethod $method, string $type = '')

No description

applyRules(PhpMethod $method, StructAttribute $attribute, $parameterName, bool $itemType = false)

No description

Details

__construct(Generator $generator, string $name)

Parameters

Generator $generator
string $name

AbstractFile setGenerator(Generator $generator)

Parameters

Generator $generator

Return Value

AbstractFile

Generator getGenerator()

Return Value

Generator

void write()

Return Value

void

void writeFile(bool $withSrc = true)

Parameters

bool $withSrc

Return Value

void

See also

\WsdlToPhp\PackageGenerator\File\AbstractFile::writeFile()

string getFileName()

Return Value

string

string getFileDestination(bool $withSrc = true)

Parameters

bool $withSrc

Return Value

string

string getFileExtension()

Return Value

string

protected AbstractFile setFile(PhpFile $file)

Parameters

PhpFile $file

Return Value

AbstractFile

PhpFile getFile()

Return Value

PhpFile

string getDestinationFolder(bool $withSrc = true)

Parameters

bool $withSrc

Return Value

string

protected AbstractModelFile addAnnotationBlock()

Return Value

AbstractModelFile

AbstractModelFile setModel(AbstractModel $model)

Parameters

AbstractModel $model

Return Value

AbstractModelFile

Exceptions

InvalidArgumentException

See also

\WsdlToPhp\PackageGenerator\File\AbstractModelFile::setModel()

AbstractModel getModel()

Return Value

AbstractModel

See also

\WsdlToPhp\PackageGenerator\File\AbstractModelFile::getModel()

protected Struct|null getModelByName(string $name)

Parameters

string $name

Return Value

Struct|null

protected AbstractModelFile definePackageAnnotations(PhpAnnotationBlock $block)

Parameters

PhpAnnotationBlock $block

Return Value

AbstractModelFile

protected string getPackageName()

Return Value

string

protected AbstractModelFile defineGeneralAnnotations(PhpAnnotationBlock $block)

Parameters

PhpAnnotationBlock $block

Return Value

AbstractModelFile

protected PhpAnnotationBlock getClassAnnotationBlock()

Return Value

PhpAnnotationBlock

protected string getClassDeclarationLine()

Return Value

string

protected string getClassDeclarationLineText()

Return Value

string

protected AbstractModelFile defineModelAnnotationsFromWsdl(PhpAnnotationBlock $block, AbstractModel $model = null)

Parameters

PhpAnnotationBlock $block
AbstractModel $model

Return Value

AbstractModelFile

protected AbstractModelFile addClassElement()

Return Value

AbstractModelFile

protected AbstractModelFile defineNamespace()

Return Value

AbstractModelFile

protected AbstractModelFile defineUseStatement()

Return Value

AbstractModelFile

protected AbstractModelFile defineConstants(PhpClass $class)

Parameters

PhpClass $class

Return Value

AbstractModelFile

protected AbstractModelFile defineProperties(PhpClass $class)

Parameters

PhpClass $class

Return Value

AbstractModelFile

protected AbstractModelFile defineMethods(PhpClass $class)

Parameters

PhpClass $class

Return Value

AbstractModelFile

protected getClassConstants(Constant $constants)

Parameters

Constant $constants

See also

\WsdlToPhp\PackageGenerator\File\AbstractModelFile::getClassConstants()

protected PhpAnnotationBlock|null getConstantAnnotationBlock(PhpConstant $constant)

Parameters

PhpConstant $constant

Return Value

PhpAnnotationBlock|null

See also

\WsdlToPhp\PackageGenerator\File\AbstractModelFile::getConstantAnnotationBlock()

protected getClassProperties(Property $properties)

Parameters

Property $properties

protected PhpAnnotationBlock|null getPropertyAnnotationBlock(PhpProperty $property)

Parameters

PhpProperty $property

Return Value

PhpAnnotationBlock|null

protected void fillClassMethods()

This method is responsible for filling in the $methods property with appropriate methods for the current model

Return Value

void

protected PhpAnnotationBlock|null getMethodAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock|null

protected AbstractModelFile defineStringMethod(PhpClass $class)

Parameters

PhpClass $class

Return Value

AbstractModelFile

protected PhpAnnotationBlock getToStringMethodAnnotationBlock()

Return Value

PhpAnnotationBlock

protected PhpMethod getToStringMethod()

Return Value

PhpMethod

protected StructAttribute getStructAttribute(StructAttribute $attribute = null)

Parameters

StructAttribute $attribute

Return Value

StructAttribute

Struct|null getModelFromStructAttribute(StructAttribute $attribute = null)

Parameters

StructAttribute $attribute

Return Value

Struct|null

Struct|null getRestrictionFromStructAttribute(StructAttribute $attribute = null)

Parameters

StructAttribute $attribute

Return Value

Struct|null

bool isAttributeAList(StructAttribute $attribute = null)

Parameters

StructAttribute $attribute

Return Value

bool

string getStructAttributeType(StructAttribute $attribute = null, bool $namespaced = false)

Parameters

StructAttribute $attribute
bool $namespaced

Return Value

string

protected string getStructAttributeTypeGetAnnotation(StructAttribute $attribute = null, bool $returnArrayType = true)

Parameters

StructAttribute $attribute
bool $returnArrayType

Return Value

string

protected string getStructAttributeTypeSetAnnotation(StructAttribute $attribute = null, bool $returnArrayType = true)

Parameters

StructAttribute $attribute
bool $returnArrayType

Return Value

string

protected bool useBrackets(StructAttribute $attribute, bool $returnArrayType = true)

Parameters

StructAttribute $attribute
bool $returnArrayType

Return Value

bool

protected string getStructAttributeTypeHint(StructAttribute $attribute = null, bool $returnArrayType = true)

Parameters

StructAttribute $attribute
bool $returnArrayType

Return Value

string

string getStructAttributeTypeAsPhpType(StructAttribute $attribute = null)

Parameters

StructAttribute $attribute

Return Value

string

static mixed getValidType($type, $xsdTypesPath = null, $fallback = null)

See http://php.net/manual/fr/language.oop5.typehinting.php for these cases Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp

Parameters

$type
$xsdTypesPath
$fallback

Return Value

mixed

static mixed getPhpType($type, $xsdTypesPath = null, $fallback = self::TYPE_STRING)

See http://php.net/manual/fr/language.oop5.typehinting.php for these cases Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp

Parameters

$type
$xsdTypesPath
$fallback

Return Value

mixed

protected StructAttribute getModelAttributes(bool $includeInheritanceAttributes = false, bool $requiredFirst = true)

Parameters

bool $includeInheritanceAttributes include the attributes of parent class, default parent attributes are not included. If true, then the array is an associative array containing and index "attribute" for the StructAttribute object and an index "model" for the Struct object.
bool $requiredFirst places the required attributes first, then the not required in order to have the _contrust method with the required attribute at first

Return Value

StructAttribute

protected Struct addStructMethodConstruct()

Return Value

Struct

protected Struct addStructMethodConstructBody(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

Struct

protected Struct addStructMethodConstructBodyForAttribute(PhpMethod $method, StructAttribute $attribute, bool $isLast)

Parameters

PhpMethod $method
StructAttribute $attribute
bool $isLast

Return Value

Struct

protected PhpFunctionParameter[] getStructMethodParametersValues()

Return Value

PhpFunctionParameter[]

protected PhpFunctionParameter getStructMethodParameter(StructAttribute $attribute, bool $lowCaseFirstLetter = false, mixed $defaultValue = null)

Parameters

StructAttribute $attribute
bool $lowCaseFirstLetter
mixed $defaultValue

Return Value

PhpFunctionParameter

protected string|null getStructMethodParameterType(StructAttribute $attribute, bool $returnArrayType = true)

Parameters

StructAttribute $attribute
bool $returnArrayType

Return Value

string|null

protected Struct addStructMethodsSetAndGet()

Return Value

Struct

protected Struct addStructMethodAddTo(StructAttribute $attribute)

Parameters

StructAttribute $attribute

Return Value

Struct

protected Struct addStructMethodAddToBody(PhpMethod $method, StructAttribute $attribute)

Parameters

PhpMethod $method
StructAttribute $attribute

Return Value

Struct

protected Struct addStructMethodSet(StructAttribute $attribute)

Parameters

StructAttribute $attribute

Return Value

Struct

protected Struct addStructMethodSetBody(PhpMethod $method, StructAttribute $attribute)

Parameters

PhpMethod $method
StructAttribute $attribute

Return Value

Struct

protected Struct addStructMethodSetBodyAssignment(PhpMethod $method, StructAttribute $attribute, string $parameterName)

Parameters

PhpMethod $method
StructAttribute $attribute
string $parameterName

Return Value

Struct

protected Struct addStructMethodSetBodyReturn(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

Struct

protected string getStructMethodSetBodyAssignment(StructAttribute $attribute, string $parameterName)

Parameters

StructAttribute $attribute
string $parameterName

Return Value

string

protected Struct addStructMethodGetBody(PhpMethod $method, StructAttribute $attribute, string $thisAccess)

Parameters

PhpMethod $method
StructAttribute $attribute
string $thisAccess

Return Value

Struct

protected Struct addStructMethodGetBodyReturn(PhpMethod $method, StructAttribute $attribute, string $thisAccess)

Parameters

PhpMethod $method
StructAttribute $attribute
string $thisAccess

Return Value

Struct

protected Struct addStructMethodGet(StructAttribute $attribute)

Parameters

StructAttribute $attribute

Return Value

Struct

protected PhpFunctionParameter[] getStructMethodGetParameters(StructAttribute $attribute)

Parameters

StructAttribute $attribute

Return Value

PhpFunctionParameter[]

protected Struct addStructMethodSetState()

Return Value

Struct

protected PhpAnnotationBlock|null getStructMethodAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock|null

protected PhpAnnotationBlock getStructMethodConstructAnnotationBlock()

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodSetStateAnnotationBlock()

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodsSetAndGetAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock

protected Struct addStructMethodsSetAndGetAnnotationBlockFromStructAttribute(string $setOrGet, PhpAnnotationBlock $annotationBlock, StructAttribute $attribute)

Parameters

string $setOrGet
PhpAnnotationBlock $annotationBlock
StructAttribute $attribute

Return Value

Struct

protected Struct addStructMethodsSetAndGetAnnotationBlockFromScalar(string $setOrGet, PhpAnnotationBlock $annotationBlock, string $attributeName)

Parameters

string $setOrGet
PhpAnnotationBlock $annotationBlock
string $attributeName

Return Value

Struct

protected Struct addStructMethodsSetAnnotationBlock(PhpAnnotationBlock $annotationBlock, string $type, string $name)

Parameters

PhpAnnotationBlock $annotationBlock
string $type
string $name

Return Value

Struct

protected Struct addStructMethodsGetAnnotationBlock(PhpAnnotationBlock $annotationBlock, string $attributeType)

Parameters

PhpAnnotationBlock $annotationBlock
string $attributeType

Return Value

Struct

protected Struct addStructMethodsGetAnnotationBlockFromXmlAttribute(PhpAnnotationBlock $annotationBlock, StructAttribute $attribute)

Parameters

PhpAnnotationBlock $annotationBlock
StructAttribute $attribute

Return Value

Struct

protected Struct addStructPropertiesToAnnotationBlock(PhpAnnotationBlock $annotationBlock)

Parameters

PhpAnnotationBlock $annotationBlock

Return Value

Struct

protected Struct addStructPropertiesToAnnotationBlockUses(PhpAnnotationBlock $annotationBlock)

Parameters

PhpAnnotationBlock $annotationBlock

Return Value

Struct

protected Struct addStructPropertiesToAnnotationBlockParams(PhpAnnotationBlock $annotationBlock)

Parameters

PhpAnnotationBlock $annotationBlock

Return Value

Struct

protected PhpAnnotationBlock getStructMethodsAddToAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodsValidateArrayAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodsValidateUnionAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodsValidateChoiceAnnotationBlock(PhpMethod $method)

Parameters

PhpMethod $method

Return Value

PhpAnnotationBlock

protected PhpAnnotationBlock getStructMethodsValidateLengthAnnotationBlock(PhpMethod $method, string $type = '')

Parameters

PhpMethod $method
string $type

Return Value

PhpAnnotationBlock

protected applyRules(PhpMethod $method, StructAttribute $attribute, $parameterName, bool $itemType = false)

Parameters

PhpMethod $method
StructAttribute $attribute
$parameterName
bool $itemType