Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DeepCopy.php

function DeepCopy::__construct

Parameters

bool $useCloneMethod If set to true, when an object implements the __clone() function, it will be used: instead of the regular deep cloning.

File

vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php, line 63

Class

DeepCopy
@final

Namespace

DeepCopy

Code

public function __construct($useCloneMethod = false) {
    $this->useCloneMethod = $useCloneMethod;
    $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class));
    $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class));
    $this->addTypeFilter(new DatePeriodFilter(), new TypeMatcher(DatePeriod::class));
    $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class));
}
RSS feed
Powered by Drupal