PHP Class WsdlToPhp\PackageGenerator\Model\AbstractModel

Inheritance: extends WsdlToPhp\PackageGenerator\Generator\AbstractGeneratorAware
显示文件 Open project: wsdltophp/packagegenerator Class Usage Examples

Public Methods

Method Description
__construct ( Generator $generator, string $name ) Main constructor
addMeta ( string $metaName, mixed $metaValue ) : AbstractModel Add meta information to the operation
cleanString ( string $string, boolean $keepMultipleUnderscores = true ) : string Clean a string to make it valid as PHP variable
getCleanName ( boolean $keepMultipleUnderscores = true ) : string Returns a valid clean name for PHP
getContextualPart ( ) : string Allows to define 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 | null Allows to define from which class the curent model extends
getExtendsClassName ( ) : string
getInheritance ( ) : string Returns the name of the class the current class inherits from
getInheritedMoel ( ) : Struct
getIsAbstract ( ) : boolean
getMeta ( ) : string[] Returns the meta
getMetaValue ( string $metaName, mixed $fallback = null ) : mixed Returns a meta value according to its name
getMetaValueFirstSet ( array $names, mixed $fallback = null ) : mixed Returns the value of the first meta value assigned to the name
getName ( ) : string Returns the original name extracted from the WSDL
getNamespace ( ) : string
getOwner ( ) : AbstractModel Returns the owner model object
getPackagedName ( $namespaced = false ) : string Returns the packaged name
getReservedMethodsInstance ( $filename = null ) : AbstractReservedWord
getSubDirectory ( ) : string Returns directory where to store class and create it if needed
nameIsClean ( ) : boolean Returns true if the original name is safe to use as a PHP property, variable name or class name
purgePhpReservedKeywords ( ) Gives the availability for test purpose and multiple package generation to purge reserved keywords usage
purgeReservedMethods ( ) Gives the availability for test purpose and multiple package generation to purge reserved methods usage
purgeUniqueNames ( ) Gives the availability for test purpose and multiple package generation to purge unique names
replacePhpReservedKeyword ( string $keyword, string $context = null ) : string Returns a usable keyword for a original keyword
replaceReservedMethod ( $methodName, string $context = null ) : string Returns a usable method for a original method
setDocumentation ( string $documentation ) : AbstractModel Sets the documentation meta value.
setInheritance ( $inheritance = '' ) Sets the name of the class the current class inherits from
setIsAbstract ( boolean $isAbstract ) : AbstractModel
setMeta ( array $meta = [] ) : AbstractModel Sets the meta
setName ( string $name ) : AbstractModel Sets the original name extracted from the WSDL
setOwner ( AbstractModel $owner ) : AbstractModel Sets the owner model object

Protected Methods

Method Description
uniqueName ( string $name, string $context ) : string Static method wich returns a unique name case sensitively Useful to name methods case sensitively distinct, see http://the-echoplex.net/log/php-case-sensitivity

Method Details

__construct() public method

Main constructor
public __construct ( Generator $generator, string $name )
$generator WsdlToPhp\PackageGenerator\Generator\Generator
$name string the original name

addMeta() public method

Add meta information to the operation
public addMeta ( string $metaName, mixed $metaValue ) : AbstractModel
$metaName string
$metaValue mixed
return AbstractModel

cleanString() public static method

Clean a string to make it valid as PHP variable
public static cleanString ( string $string, boolean $keepMultipleUnderscores = true ) : string
$string string the string to clean
$keepMultipleUnderscores boolean optional, allows to keep the multiple consecutive underscores
return string

getCleanName() public method

Returns a valid clean name for PHP
public getCleanName ( boolean $keepMultipleUnderscores = true ) : string
$keepMultipleUnderscores boolean optional, allows to keep the multiple consecutive underscores
return string

getContextualPart() public method

Allows to define the contextual part of the class name for the package
public getContextualPart ( ) : string
return string

getDocSubPackages() public method

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

getExtends() public method

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

getExtendsClassName() public method

public getExtendsClassName ( ) : string
return string

getInheritance() public method

Returns the name of the class the current class inherits from
public getInheritance ( ) : string
return string

getInheritedMoel() public method

public getInheritedMoel ( ) : Struct
return Struct

getIsAbstract() public method

public getIsAbstract ( ) : boolean
return boolean

getMeta() public method

Returns the meta
public getMeta ( ) : string[]
return string[]

getMetaValue() public method

Returns a meta value according to its name
public getMetaValue ( string $metaName, mixed $fallback = null ) : mixed
$metaName string the meta information name
$fallback mixed the fallback value if unset
return mixed the meta information value

getMetaValueFirstSet() public method

Returns the value of the first meta value assigned to the name
public getMetaValueFirstSet ( array $names, mixed $fallback = null ) : mixed
$names array the meta names to check
$fallback mixed the fallback value if anyone is set
return mixed the meta information value

getName() public method

Returns the original name extracted from the WSDL
public getName ( ) : string
return string

getNamespace() public method

public getNamespace ( ) : string
return string

getOwner() public method

Returns the owner model object
public getOwner ( ) : AbstractModel
return AbstractModel

getPackagedName() public method

Returns the packaged name
public getPackagedName ( $namespaced = false ) : string
return string

getReservedMethodsInstance() public method

public getReservedMethodsInstance ( $filename = null ) : AbstractReservedWord
$filename
return WsdlToPhp\PackageGenerator\ConfigurationReader\AbstractReservedWord

getSubDirectory() public method

Returns directory where to store class and create it if needed
public getSubDirectory ( ) : string
return string

nameIsClean() public method

Returns true if the original name is safe to use as a PHP property, variable name or class name
public nameIsClean ( ) : boolean
return boolean

purgePhpReservedKeywords() public static method

Gives the availability for test purpose and multiple package generation to purge reserved keywords usage
public static purgePhpReservedKeywords ( )

purgeReservedMethods() public static method

Gives the availability for test purpose and multiple package generation to purge reserved methods usage
public static purgeReservedMethods ( )

purgeUniqueNames() public static method

Gives the availability for test purpose and multiple package generation to purge unique names
public static purgeUniqueNames ( )

replacePhpReservedKeyword() public static method

Returns a usable keyword for a original keyword
public static replacePhpReservedKeyword ( string $keyword, string $context = null ) : string
$keyword string the keyword
$context string the context
return string

replaceReservedMethod() public method

Returns a usable method for a original method
public replaceReservedMethod ( $methodName, string $context = null ) : string
$context string the context
return string

setDocumentation() public method

Documentation is set as an array so if multiple documentation nodes are set for an unique element, it will gather them.
public setDocumentation ( string $documentation ) : AbstractModel
$documentation string the documentation from the WSDL
return AbstractModel

setInheritance() public method

Sets the name of the class the current class inherits from
public setInheritance ( $inheritance = '' )

setIsAbstract() public method

public setIsAbstract ( boolean $isAbstract ) : AbstractModel
$isAbstract boolean
return AbstractModel

setMeta() public method

Sets the meta
public setMeta ( array $meta = [] ) : AbstractModel
$meta array
return AbstractModel

setName() public method

Sets the original name extracted from the WSDL
public setName ( string $name ) : AbstractModel
$name string
return AbstractModel

setOwner() public method

Sets the owner model object
public setOwner ( AbstractModel $owner ) : AbstractModel
$owner AbstractModel object the owner of the current model
return AbstractModel

uniqueName() protected static method

Static method wich returns a unique name case sensitively Useful to name methods case sensitively distinct, see http://the-echoplex.net/log/php-case-sensitivity
protected static uniqueName ( string $name, string $context ) : string
$name string the original name
$context string the context where the name is needed unique
return string