PHP Class WsdlToPhp\PackageGenerator\Model\Struct

Inheritance: extends AbstractModel
显示文件 Open project: wsdltophp/packagegenerator Class Usage Examples

Public Methods

Method Description
__construct ( Generator $generator, string $name, boolean $isStruct = true, boolean $isRestriction = false ) Main constructor
addAttribute ( string $attributeName, string $attributeType ) : Struct Adds attribute based on its original name
addValue ( mixed $value ) : Struct Adds value to values array
countOwnAttributes ( ) : integer Returns the number of own attributes
getAttribute ( string $attributeName ) : StructAttribute | null Returns the attribute by its name, otherwise null
getAttributes ( boolean $includeInheritanceAttributes = false, boolean $requiredFirst = false ) : StructAttribute Returns the attributes of the struct and potentially from the parent class
getContextualPart ( ) : string Returns the contextual part of the class name for the package
getDocSubPackages ( ) : array Returns the sub package name which the model belongs to Must be overridden by sub classes
getExtends ( boolean $short = false ) : string Allows to define from which class the curent model extends
getInheritanceStruct ( ) : Struct | null
getIsRestriction ( ) : boolean Returns the isRestriction value
getIsStruct ( ) : boolean Returns the isStruct value
getMeta ( ) : string[]
getReservedMethodsInstance ( $filename = null ) : StructReservedMethod | StructArrayReservedMethod
getTopInheritance ( ) : Struct | null
getValue ( string $value ) : StructValue | null Gets the value object for the given value
getValues ( ) : StructValue Returns the values for an enumeration
isArray ( ) : boolean Returns true if the current struct is a collection of values (like an array)
setAttributes ( StructAttribute $structAttributeContainer ) : Struct Sets the attributes of the struct
setIsRestriction ( boolean $isRestriction = true ) : Struct Sets the isRestriction value
setIsStruct ( boolean $isStruct = true ) : Struct Sets the isStruct value

Protected Methods

Method Description
addInheritanceAttributes ( StructAttribute $attributes )
getAllAttributes ( boolean $includeInheritanceAttributes, boolean $requiredFirst ) : StructAttribute
putRequiredFirst ( StructAttribute $allAttributes ) : StructAttribute

Private Methods

Method Description
setValues ( StructValue $structValueContainer ) : Struct Sets the values for an enumeration

Method Details

__construct() public method

Main constructor
See also: AbstractModel::__construct()
public __construct ( Generator $generator, string $name, boolean $isStruct = true, boolean $isRestriction = false )
$generator WsdlToPhp\PackageGenerator\Generator\Generator
$name string the original name
$isStruct boolean defines if it's a real sruct or not
$isRestriction boolean defines if it's an enumeration or not

addAttribute() public method

Adds attribute based on its original name
public addAttribute ( string $attributeName, string $attributeType ) : Struct
$attributeName string the attribute name
$attributeType string the attribute type
return Struct

addInheritanceAttributes() protected method

protected addInheritanceAttributes ( StructAttribute $attributes )
$attributes WsdlToPhp\PackageGenerator\Container\Model\StructAttribute

addValue() public method

Adds value to values array
public addValue ( mixed $value ) : Struct
$value mixed the original value
return Struct

countOwnAttributes() public method

Returns the number of own attributes
public countOwnAttributes ( ) : integer
return integer

getAllAttributes() protected method

protected getAllAttributes ( boolean $includeInheritanceAttributes, boolean $requiredFirst ) : StructAttribute
$includeInheritanceAttributes boolean
$requiredFirst boolean
return WsdlToPhp\PackageGenerator\Container\Model\StructAttribute

getAttribute() public method

Returns the attribute by its name, otherwise null
public getAttribute ( string $attributeName ) : StructAttribute | null
$attributeName string the original attribute name
return StructAttribute | null

getAttributes() public method

Returns the attributes of the struct and potentially from the parent class
public getAttributes ( boolean $includeInheritanceAttributes = false, boolean $requiredFirst = false ) : StructAttribute
$includeInheritanceAttributes boolean 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.
$requiredFirst boolean places the required attributes first, then the not required in order to have the _contrust method with the required attribute at first
return WsdlToPhp\PackageGenerator\Container\Model\StructAttribute

getContextualPart() public method

Returns the contextual part of the class name for the package
See also: AbstractModel::getContextualPart()
public getContextualPart ( ) : string
return string

getDocSubPackages() public method

Returns the sub package name which the model belongs to Must be overridden by sub classes
See also: AbstractModel::getDocSubPackages()
public getDocSubPackages ( ) : array
return array

getExtends() public method

Allows to define from which class the curent model extends
public getExtends ( boolean $short = false ) : string
$short boolean
return string

getInheritanceStruct() public method

public getInheritanceStruct ( ) : Struct | null
return Struct | null

getIsRestriction() public method

Returns the isRestriction value
public getIsRestriction ( ) : boolean
return boolean

getIsStruct() public method

Returns the isStruct value
public getIsStruct ( ) : boolean
return boolean

getMeta() public method

See also: WsdlToPhp\PackageGenerator\Model\AbstractModel::getMeta()
public getMeta ( ) : string[]
return string[]

getReservedMethodsInstance() public method

public getReservedMethodsInstance ( $filename = null ) : StructReservedMethod | StructArrayReservedMethod
$filename
return WsdlToPhp\PackageGenerator\ConfigurationReader\StructReservedMethod | WsdlToPhp\PackageGenerator\ConfigurationReader\StructArrayReservedMethod

getTopInheritance() public method

public getTopInheritance ( ) : Struct | null
return Struct | null

getValue() public method

Gets the value object for the given value
public getValue ( string $value ) : StructValue | null
$value string Value name
return StructValue | null

getValues() public method

Returns the values for an enumeration
public getValues ( ) : StructValue
return WsdlToPhp\PackageGenerator\Container\Model\StructValue

isArray() public method

Returns true if the current struct is a collection of values (like an array)
public isArray ( ) : boolean
return boolean

putRequiredFirst() protected method

protected putRequiredFirst ( StructAttribute $allAttributes ) : StructAttribute
$allAttributes WsdlToPhp\PackageGenerator\Container\Model\StructAttribute
return WsdlToPhp\PackageGenerator\Container\Model\StructAttribute

setAttributes() public method

Sets the attributes of the struct
public setAttributes ( StructAttribute $structAttributeContainer ) : Struct
$structAttributeContainer WsdlToPhp\PackageGenerator\Container\Model\StructAttribute
return Struct

setIsRestriction() public method

Sets the isRestriction value
public setIsRestriction ( boolean $isRestriction = true ) : Struct
$isRestriction boolean
return Struct

setIsStruct() public method

Sets the isStruct value
public setIsStruct ( boolean $isStruct = true ) : Struct
$isStruct boolean
return Struct