class InstanceCopy

InstanceCopy ist für die Erzeugung echten rekrusiven Kopien von Objekten gedacht.

Da die clone Funktion nur das Objekt, aber keine Objekte in Arrays usw. klont kommt InstanceCopy zum Einsatz.

Properties

protected array $hashMap
protected mixed $instance

Methods

__construct(mixed $instance)

Objekt

mixed
getClone()

Kopie der Instanz herstellen

mixed
cloneInstance()

Kopie der Instanz herstellen

mixed
getRecursiveCopy(mixed $instance)

Rekursive Kopie anfertigen

setClonedObjectPropertyValue(Alvine $object, ReflectionProperty $property)

Properties clonen

object
getClonedObject(object $object, boolean $cloneRoot = true)

Objekt prüfen

mixed
cloneObject(ReflectionObject $reflectedObject, string $objectHash, object $object)

Objekt klonen

array
getClonedArray(array $array)

Array kopieren

Details

at line 58
__construct(mixed $instance)

Objekt

Parameters

mixed $instance

at line 71
mixed getClone()

Kopie der Instanz herstellen

Return Value

mixed

at line 80
mixed cloneInstance()

Kopie der Instanz herstellen

Return Value

mixed

at line 94
protected mixed getRecursiveCopy(mixed $instance)

Rekursive Kopie anfertigen

Parameters

mixed $instance

Return Value

mixed Wert

Exceptions

CloneNotSupportedException

at line 119
protected InstanceCopy setClonedObjectPropertyValue(Alvine $object, ReflectionProperty $property)

Properties clonen

Parameters

Alvine $object
ReflectionProperty $property

Return Value

InstanceCopy

at line 138
protected object getClonedObject(object $object, boolean $cloneRoot = true)

Objekt prüfen

Parameters

object $object
boolean $cloneRoot

Return Value

object

Exceptions

CloneNotSupportedException

at line 157
protected mixed cloneObject(ReflectionObject $reflectedObject, string $objectHash, object $object)

Objekt klonen

Parameters

ReflectionObject $reflectedObject
string $objectHash
object $object

Return Value

mixed

at line 172
protected array getClonedArray(array $array)

Array kopieren

Parameters

array $array

Return Value

array