PHP 클래스 Jarves\Configuration\Model

상속: implements ArrayAccess
파일 보기 프로젝트 열기: jarves/jarves 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$serialisationJarvesCore Jarves\Jarves

보호된 프로퍼티들

프로퍼티 타입 설명
$_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.

공개 메소드들

메소드 설명
__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.

보호된 메소드들

메소드 설명
checkRequirements ( ) Checks $this->requiredProperties and throws a exception when not met

메소드 상세

__construct() 공개 메소드

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

__sleep() 공개 메소드

public __sleep ( )

__toString() 공개 메소드

public __toString ( ) : string
리턴 string

__wakeup() 공개 메소드

}
public __wakeup ( )

appendXml() 공개 메소드

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

appendXmlProperty() 공개 메소드

public appendXmlProperty ( string $key, DOMNode $parentNode, boolean $printDefaults = false, boolean $printComments = false ) : DOMNode | void
$key string
$parentNode DOMNode
$printDefaults boolean
$printComments boolean
리턴 DOMNode | void

appendXmlValue() 공개 메소드

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
리턴 DOMNode

bool() 공개 메소드

public bool ( mixed $val ) : boolean
$val mixed
리턴 boolean

canPropertyBeExported() 공개 메소드

public canPropertyBeExported ( $key )

checkRequirements() 보호된 메소드

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

extractExtraNodes() 공개 메소드

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

fromArray() 공개 메소드

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

getAdditional() 공개 메소드

public getAdditional ( string $key ) : mixed
$key string
리턴 mixed

getAdditionalAttribute() 공개 메소드

public getAdditionalAttribute ( string $key ) : mixed
$key string
리턴 mixed

getArrayKey() 공개 메소드

public getArrayKey ( )

getArrayKeyValue() 공개 메소드

public getArrayKeyValue ( )

getClass() 공개 메소드

public getClass ( ) : string
리턴 string

getDirectChild() 공개 메소드

public getDirectChild ( string $tag ) : DOMElement
$tag string
리턴 DOMElement

getDirectChildren() 공개 메소드

public getDirectChildren ( string $tag ) : DOMElement[]
$tag string
리턴 DOMElement[]

getDocBlock() 공개 메소드

public getDocBlock ( ) : string
리턴 string

getDocBlocks() 공개 메소드

public getDocBlocks ( ) : array
리턴 array

getElement() 공개 메소드

public getElement ( ) : DOMElement
리턴 DOMElement

getElementArrayName() 공개 메소드

public getElementArrayName ( $property )

getJarves() 공개 메소드

public getJarves ( ) : Jarves
리턴 Jarves\Jarves

getMethodMetaData() 공개 메소드

public getMethodMetaData ( ReflectionMethod | ReflectionClass $reflection ) : array | boolean
$reflection ReflectionMethod | ReflectionClass
리턴 array | boolean

getNamespacePath() 공개 메소드

public getNamespacePath ( )

getParameterValues() 공개 메소드

=> 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
리턴 array

getPropertyDescription() 공개 메소드

public getPropertyDescription ( string $property ) : null | string
$property string
리턴 null | string

getRootName() 공개 메소드

public getRootName ( ) : string
리턴 string

importNode() 공개 메소드

public importNode ( DOMNode $element ) : array
$element DOMNode
리턴 array imported properties

initialize() 공개 메소드

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

offsetExists() 공개 메소드

public offsetExists ( mixed $offset ) : boolean
$offset mixed
리턴 boolean

offsetGet() 공개 메소드

public offsetGet ( mixed $offset ) : mixed
$offset mixed
리턴 mixed

offsetSet() 공개 메소드

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

offsetUnset() 공개 메소드

public offsetUnset ( mixed $offset )
$offset mixed

parsePhpDoc() 공개 메소드

Parse phpDoc string and returns an array.
public parsePhpDoc ( string $string ) : array
$string string
리턴 array

propertyFromArray() 공개 메소드

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

propertyToArray() 공개 메소드

public propertyToArray ( string $k, $printDefaults = false ) : mixed
$k string name of the property
$printDefaults
리턴 mixed

save() 공개 메소드

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

setArrayKeyValue() 공개 메소드

public setArrayKeyValue ( $value )

setAttributeVar() 공개 메소드

public setAttributeVar ( string $variableName )
$variableName string

setElement() 공개 메소드

public setElement ( DOMElement $element )
$element DOMElement

setJarves() 공개 메소드

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

setVar() 공개 메소드

public setVar ( string $variableName )
$variableName string

setupObject() 공개 메소드

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

toArray() 공개 메소드

public toArray ( boolean $printDefaults = false ) : array
$printDefaults boolean
리턴 array

toXml() 공개 메소드

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

프로퍼티 상세

$_defaultProperties 보호되어 있는 프로퍼티

protected $_defaultProperties

$_excludeFromExport 보호되어 있는 프로퍼티

protected array $_excludeFromExport
리턴 array

$_modelProperties 보호되어 있는 프로퍼티

protected $_modelProperties

$additionalAttributes 보호되어 있는 프로퍼티

Contains the additional (not defined properties) attributes.
protected array $additionalAttributes
리턴 array

$additionalNodes 보호되어 있는 프로퍼티

Contains the additional (not defined properties) children nodes.
protected array $additionalNodes
리턴 array

$arrayIndexNames 보호되어 있는 프로퍼티

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
리턴 array

$arrayKey 보호되어 있는 프로퍼티

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

$attributes 보호되어 있는 프로퍼티

Defines which values are attributes of the element.
protected array $attributes
리턴 array

$docBlock 보호되어 있는 프로퍼티

Defines a comment for the root element.
protected string $docBlock
리턴 string

$docBlocks 보호되어 있는 프로퍼티

Example: ['caches' => 'blabla']
protected array $docBlocks
리턴 array

$element 보호되어 있는 프로퍼티

The element passed in constructor.
protected DOMElement $element
리턴 DOMElement

$elementToArray 보호되어 있는 프로퍼티

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

$excludeDefaults 보호되어 있는 프로퍼티

Defines which properties should be excluded when they have the default value.
protected array $excludeDefaults
리턴 array

$jarves 보호되어 있는 프로퍼티

protected Jarves,Jarves $jarves
리턴 Jarves\Jarves

$lastRootElementComment 보호되어 있는 프로퍼티

protected $lastRootElementComment

$nodeValueVar 보호되어 있는 프로퍼티

Defines which property is used as the nodeValue.
protected string $nodeValueVar
리턴 string

$requiredProperties 보호되어 있는 프로퍼티

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

$rootName 보호되어 있는 프로퍼티

The name of the element of this class.
protected string $rootName
리턴 string

$serialisationJarvesCore 공개적으로 정적으로 프로퍼티

public static Jarves,Jarves $serialisationJarvesCore
리턴 Jarves\Jarves