PHP Class Jarves\Configuration\Model

Inheritance: implements ArrayAccess
Afficher le fichier Open project: jarves/jarves Class Usage Examples

Méthodes publiques

Свойство Type Description
$serialisationJarvesCore Jarves\Jarves

Protected Properties

Свойство Type Description
$_defaultProperties
$_excludeFromExport array
$_modelProperties
$additionalAttributes array Contains the additional (not defined properties) attributes.
$additionalNodes array Contains the additional (not defined properties) children nodes.
$arrayIndexNames array Scenario: ConfigClass => protected $modules; //@var array protected $arrayIndexNames = ['modules' => 'module']; Resulted xml: value value2 If you not defined $arrayIndexNames and if you don't have a proper class name as @var then it will export '' children instead of the ''.
$arrayKey ConfigCacheClass[] Scenario: ConfigClass => protected $caches; //@var ConfigCacheClass[] ConfigCacheClass => protected $id; protected $value; protected $arrayKey => 'id'; ConfigClass->propertyToArray('caches') -> array('' => $ConfigCacheClass, ...)
$attributes array Defines which values are attributes of the element.
$docBlock string Defines a comment for the root element.
$docBlocks array Example: ['caches' => 'blabla']
$element DOMElement The element passed in constructor.
$elementToArray ConfigCacheClass[] Scenario: foo bar Example: ConfigClass => protected $elementToArray = ['cache' => 'caches']; protected $caches; //@var ConfigCacheClass[]
$excludeDefaults array Defines which properties should be excluded when they have the default value.
$jarves Jarves\Jarves
$lastRootElementComment
$nodeValueVar string Defines which property is used as the nodeValue.
$requiredProperties string[] A list of property names that are required and can no be ommited or be null.
$rootName string The name of the element of this class.

Méthodes publiques

Méthode Description
__construct ( DOMElement | array | string $values = null, Jarves $jarves = null )
__sleep ( )
__toString ( ) : string
__wakeup ( ) }
appendXml ( DOMNode $node, boolean $printDefaults = false, boolean $printComments = false ) : DOMElement Appends the xml structure with our values.
appendXmlProperty ( string $key, DOMNode $parentNode, boolean $printDefaults = false, boolean $printComments = false ) : DOMNode | void
appendXmlValue ( string $key, mixed $value, DOMNode $node, boolean $arrayType = false, boolean $printDefaults = false, boolean $printComments = false ) : DOMNode Appends the xm structure with the given values.
bool ( mixed $val ) : boolean
canPropertyBeExported ( $key )
extractExtraNodes ( DOMNode $child, array &$options )
fromArray ( mixed $values, string $arrayKeyValue = null )
getAdditional ( string $key ) : mixed
getAdditionalAttribute ( string $key ) : mixed
getArrayKey ( )
getArrayKeyValue ( )
getClass ( ) : string
getDirectChild ( string $tag ) : DOMElement
getDirectChildren ( string $tag ) : DOMElement[]
getDocBlock ( ) : string
getDocBlocks ( ) : array
getElement ( ) : DOMElement
getElementArrayName ( $property )
getJarves ( ) : Jarves
getMethodMetaData ( ReflectionMethod | ReflectionClass $reflection ) : array | boolean
getNamespacePath ( )
getParameterValues ( string $element = 'parameters', string $childrenElement = 'parameter', string $keyName = 'id' ) : array first second bar sa
getPropertyDescription ( string $property ) : null | string
getRootName ( ) : string
importNode ( DOMNode $element ) : array
initialize ( $values = null, $jarves = null )
offsetExists ( mixed $offset ) : boolean
offsetGet ( mixed $offset ) : mixed
offsetSet ( mixed $offset, mixed $value )
offsetUnset ( mixed $offset )
parsePhpDoc ( string $string ) : array Parse phpDoc string and returns an array.
propertyFromArray ( string $key, mixed $value )
propertyToArray ( string $k, $printDefaults = false ) : mixed
save ( string $path, boolean $withDefaults = false ) : boolean Saves the xml into a file.
setArrayKeyValue ( $value )
setAttributeVar ( string $variableName )
setElement ( DOMElement $element )
setJarves ( Jarves $jarves )
setVar ( string $variableName )
setupObject ( $jarves = null ) Initialize the object.
toArray ( boolean $printDefaults = false ) : array
toXml ( boolean $printDefaults = false, boolean $printComments = false ) : string Generates a XML string with all current values.

Méthodes protégées

Méthode Description
checkRequirements ( ) Checks $this->requiredProperties and throws a exception when not met

Method Details

__construct() public méthode

public __construct ( DOMElement | array | string $values = null, Jarves $jarves = null )
$values DOMElement | array | string
$jarves Jarves\Jarves

__sleep() public méthode

public __sleep ( )

__toString() public méthode

public __toString ( ) : string
Résultat string

__wakeup() public méthode

}
public __wakeup ( )

appendXml() public méthode

Appends the xml structure with our values.
public appendXml ( DOMNode $node, boolean $printDefaults = false, boolean $printComments = false ) : DOMElement
$node DOMNode
$printDefaults boolean
$printComments boolean
Résultat DOMElement

appendXmlProperty() public méthode

public appendXmlProperty ( string $key, DOMNode $parentNode, boolean $printDefaults = false, boolean $printComments = false ) : DOMNode | void
$key string
$parentNode DOMNode
$printDefaults boolean
$printComments boolean
Résultat DOMNode | void

appendXmlValue() public méthode

Appends the xm structure with the given values.
public appendXmlValue ( string $key, mixed $value, DOMNode $node, boolean $arrayType = false, boolean $printDefaults = false, boolean $printComments = false ) : DOMNode
$key string
$value mixed
$node DOMNode
$arrayType boolean
$printDefaults boolean
$printComments boolean
Résultat DOMNode

bool() public méthode

public bool ( mixed $val ) : boolean
$val mixed
Résultat boolean

canPropertyBeExported() public méthode

public canPropertyBeExported ( $key )

checkRequirements() protected méthode

Checks $this->requiredProperties and throws a exception when not met
protected checkRequirements ( )

extractExtraNodes() public méthode

public extractExtraNodes ( DOMNode $child, array &$options )
$child DOMNode
$options array

fromArray() public méthode

public fromArray ( mixed $values, string $arrayKeyValue = null )
$values mixed
$arrayKeyValue string

getAdditional() public méthode

public getAdditional ( string $key ) : mixed
$key string
Résultat mixed

getAdditionalAttribute() public méthode

public getAdditionalAttribute ( string $key ) : mixed
$key string
Résultat mixed

getArrayKey() public méthode

public getArrayKey ( )

getArrayKeyValue() public méthode

public getArrayKeyValue ( )

getClass() public méthode

public getClass ( ) : string
Résultat string

getDirectChild() public méthode

public getDirectChild ( string $tag ) : DOMElement
$tag string
Résultat DOMElement

getDirectChildren() public méthode

public getDirectChildren ( string $tag ) : DOMElement[]
$tag string
Résultat DOMElement[]

getDocBlock() public méthode

public getDocBlock ( ) : string
Résultat string

getDocBlocks() public méthode

public getDocBlocks ( ) : array
Résultat array

getElement() public méthode

public getElement ( ) : DOMElement
Résultat DOMElement

getElementArrayName() public méthode

public getElementArrayName ( $property )

getJarves() public méthode

public getJarves ( ) : Jarves
Résultat Jarves\Jarves

getMethodMetaData() public méthode

public getMethodMetaData ( ReflectionMethod | ReflectionClass $reflection ) : array | boolean
$reflection ReflectionMethod | ReflectionClass
Résultat array | boolean

getNamespacePath() public méthode

public getNamespacePath ( )

getParameterValues() public méthode

=> array( 0 => 'first', 1 => 'second', 'foo' => 'bar', 'ho' => 'sa', )
public getParameterValues ( string $element = 'parameters', string $childrenElement = 'parameter', string $keyName = 'id' ) : array
$element string
$childrenElement string
$keyName string
Résultat array

getPropertyDescription() public méthode

public getPropertyDescription ( string $property ) : null | string
$property string
Résultat null | string

getRootName() public méthode

public getRootName ( ) : string
Résultat string

importNode() public méthode

public importNode ( DOMNode $element ) : array
$element DOMNode
Résultat array imported properties

initialize() public méthode

public initialize ( $values = null, $jarves = null )

offsetExists() public méthode

public offsetExists ( mixed $offset ) : boolean
$offset mixed
Résultat boolean

offsetGet() public méthode

public offsetGet ( mixed $offset ) : mixed
$offset mixed
Résultat mixed

offsetSet() public méthode

public offsetSet ( mixed $offset, mixed $value )
$offset mixed
$value mixed

offsetUnset() public méthode

public offsetUnset ( mixed $offset )
$offset mixed

parsePhpDoc() public méthode

Parse phpDoc string and returns an array.
public parsePhpDoc ( string $string ) : array
$string string
Résultat array

propertyFromArray() public méthode

public propertyFromArray ( string $key, mixed $value )
$key string
$value mixed

propertyToArray() public méthode

public propertyToArray ( string $k, $printDefaults = false ) : mixed
$k string name of the property
$printDefaults
Résultat mixed

save() public méthode

Saves the xml into a file.
public save ( string $path, boolean $withDefaults = false ) : boolean
$path string
$withDefaults boolean
Résultat boolean

setArrayKeyValue() public méthode

public setArrayKeyValue ( $value )

setAttributeVar() public méthode

public setAttributeVar ( string $variableName )
$variableName string

setElement() public méthode

public setElement ( DOMElement $element )
$element DOMElement

setJarves() public méthode

public setJarves ( Jarves $jarves )
$jarves Jarves\Jarves

setVar() public méthode

public setVar ( string $variableName )
$variableName string

setupObject() public méthode

Initialize the object.
public setupObject ( $jarves = null )

toArray() public méthode

public toArray ( boolean $printDefaults = false ) : array
$printDefaults boolean
Résultat array

toXml() public méthode

Generates a XML string with all current values.
public toXml ( boolean $printDefaults = false, boolean $printComments = false ) : string
$printDefaults boolean
$printComments boolean
Résultat string

Property Details

$_defaultProperties protected_oe property

protected $_defaultProperties

$_excludeFromExport protected_oe property

protected array $_excludeFromExport
Résultat array

$_modelProperties protected_oe property

protected $_modelProperties

$additionalAttributes protected_oe property

Contains the additional (not defined properties) attributes.
protected array $additionalAttributes
Résultat array

$additionalNodes protected_oe property

Contains the additional (not defined properties) children nodes.
protected array $additionalNodes
Résultat array

$arrayIndexNames protected_oe property

Scenario: ConfigClass => protected $modules; //@var array protected $arrayIndexNames = ['modules' => 'module']; Resulted xml: value value2 If you not defined $arrayIndexNames and if you don't have a proper class name as @var then it will export '' children instead of the ''.
protected array $arrayIndexNames
Résultat array

$arrayKey protected_oe property

Scenario: ConfigClass => protected $caches; //@var ConfigCacheClass[] ConfigCacheClass => protected $id; protected $value; protected $arrayKey => 'id'; ConfigClass->propertyToArray('caches') -> array('' => $ConfigCacheClass, ...)
protected ConfigCacheClass[] $arrayKey
Résultat ConfigCacheClass[]

$attributes protected_oe property

Defines which values are attributes of the element.
protected array $attributes
Résultat array

$docBlock protected_oe property

Defines a comment for the root element.
protected string $docBlock
Résultat string

$docBlocks protected_oe property

Example: ['caches' => 'blabla']
protected array $docBlocks
Résultat array

$element protected_oe property

The element passed in constructor.
protected DOMElement $element
Résultat DOMElement

$elementToArray protected_oe property

Scenario: foo bar Example: ConfigClass => protected $elementToArray = ['cache' => 'caches']; protected $caches; //@var ConfigCacheClass[]
protected ConfigCacheClass[] $elementToArray
Résultat ConfigCacheClass[]

$excludeDefaults protected_oe property

Defines which properties should be excluded when they have the default value.
protected array $excludeDefaults
Résultat array

$jarves protected_oe property

protected Jarves,Jarves $jarves
Résultat Jarves\Jarves

$lastRootElementComment protected_oe property

protected $lastRootElementComment

$nodeValueVar protected_oe property

Defines which property is used as the nodeValue.
protected string $nodeValueVar
Résultat string

$requiredProperties protected_oe property

A list of property names that are required and can no be ommited or be null.
protected string[] $requiredProperties
Résultat string[]

$rootName protected_oe property

The name of the element of this class.
protected string $rootName
Résultat string

$serialisationJarvesCore public_oe static_oe property

public static Jarves,Jarves $serialisationJarvesCore
Résultat Jarves\Jarves