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 59
__construct(mixed $instance)

Objekt

Parameters

mixed $instance

at line 72
mixed getClone()

Kopie der Instanz herstellen

Return Value

mixed

at line 81
mixed cloneInstance()

Kopie der Instanz herstellen

Return Value

mixed

at line 95
protected mixed getRecursiveCopy(mixed $instance)

Rekursive Kopie anfertigen

Parameters

mixed $instance

Return Value

mixed Wert

Exceptions

CloneNotSupportedException

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

Properties clonen

Parameters

Alvine $object
ReflectionProperty $property

Return Value

InstanceCopy

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

Objekt prüfen

Parameters

object $object
boolean $cloneRoot

Return Value

object

Exceptions

CloneNotSupportedException

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

Objekt klonen

Parameters

ReflectionObject $reflectedObject
string $objectHash
object $object

Return Value

mixed

at line 173
protected array getClonedArray(array $array)

Array kopieren

Parameters

array $array

Return Value

array