Copies the object property doctrine collection.

{@inheritdoc}
325501
public function apply(object $object, ReflectionProperty $reflectionProperty, callable $objectCopier): void
    {
        $reflectionProperty->setAccessible(true);
        /** @var Collection $oldCollection */
        $oldCollection = $reflectionProperty->getValue($object);

        $newCollection = $oldCollection->map(
            function ($item) use ($objectCopier) {
                return $objectCopier($item);
            }
        );

        $reflectionProperty->setValue($object, $newCollection);
    }
648602
public static function copy($value) {
    if(is_object($value) || is_array($value)) {
      return unserialize(serialize($value));
    }
    return $value;
  }
815060
private TransientItemData copyPropertyData(PropertyData prop) throws RepositoryException
   {

      if (prop == null)
         return null;

      // make a copy, value may be null for deleting items
      TransientPropertyData newData =
         new TransientPropertyData(prop.getQPath(), prop.getIdentifier(), prop.getPersistedVersion(), prop.getType(),
            prop.getParentIdentifier(), prop.isMultiValued(), prop.getValues());

      return newData;
   }
1110259
public static function copy($value){
		
		if(\is_object($value)){
			
			if(\is_callable($value)){
				return \Closure::bind($value, null);
			}
			
			return clone $value;
			
		}
		
		return $value;
		
	}
15714
function clone(collection, deep = true) {
		const clones = new Jamon();

		collection.forEach(element => clones.push(element.cloneNode(deep)));

		return clones;
	}
714380
private function getPropertiesToCopy(\ReflectionClass $reflectionClass, $copyingPolicy, array $idProperties)
    {
        $properties = [];

        switch ($copyingPolicy) {
            case Clonable::COPYING_POLICY_ALL:
                foreach ($reflectionClass->getProperties() as $reflectionProperty) {
                    if (null === $this->reader->getPropertyAnnotation($reflectionProperty, Skip::class)
                        && !in_array($reflectionProperty->getName(), $idProperties)
                    ) {
                        $properties[] = $reflectionProperty->getName();
                    }
                }

                break;
            case Clonable::COPYING_POLICY_NONE:
                foreach ($reflectionClass->getProperties() as $reflectionProperty) {
                    if (null !== $this->reader->getPropertyAnnotation($reflectionProperty, Copy::class)) {
                        if (in_array($reflectionProperty->getName(), $idProperties)) {
                            throw $this->createPropertyAnnotationInvalidException(
                                Copy::class,
                                $reflectionClass->getName(),
                                $reflectionProperty->getName(),
                                'property is identifier and it\'s value must not be copied during cloning'
                            );
                        }

                        $properties[] = $reflectionProperty->getName();
                    }
                }

                break;
        }

        return $properties;
    }
360797
public function transform($collection)
    {
        if (!$collection instanceof Collection) {
            // If given "collection" is an object we need to wrap it into an array, and pass into collection.
            $collection = new Collection(is_array($collection) ? $collection : [$collection]);
        }

        // If transform is declared or set, we can execute transform on his object.
        if ($this->hasTransformer()) {
            return $this->transform->executeOn($collection);
        }

        // Otherwise, we can return collection without transformation.
        return $collection;
    }
849118
public function serialize()
    {
        $properties = get_object_vars($this);
        $properties['collection'] = $this->collection->getCollectionName();

        return serialize($properties);
    }
1200187
function copyto($key) {
		$var=&\Base::instance()->ref($key);
		foreach ($this->fields+$this->adhoc as $key=>$field)
			$var[$key]=$field['value'];
	}
1051523
protected function convertJsonCollectionToArray()
    {
        if (!is_array($this->value) && is_object($this->value)) {
            $orientObjects = array();

            $refClass = new \ReflectionObject($this->value);
            $properties = $refClass->getProperties(\ReflectionProperty::IS_PUBLIC);

            foreach ($properties as $property) {
                $orientObjects[$property->name] = $this->value->{$property->name};
            }

            $this->setValue($orientObjects);
        }
    }
58148
function copy( $collectionItemID )
    {
        $item = clone $this;
        $item->setAttribute( 'item_id', $collectionItemID );
        $item->store();
        return $item;
    }
878395
public function transform($collection)
    {   
        if (!$collection instanceof Collection) {  
            return null; 
        }
        
        $data = array();
        $accessor = PropertyAccess::createPropertyAccessor();
        
        foreach ($collection as $ref){
            if (!$ref instanceof Select2SortableInterface){
                throw new \InvalidArgumentException('Reference class must be instance of Select2SortableInterface');  
            }
            
            $data[] = $accessor->getValue($ref, $this->inversedProperty)->getId();
        }
        
        $this->collection = $collection;
        
        return implode(',', $data);
    }
1118904
public function update(RepeatingFieldCollection $collection)
    {
        $updated = [];
        // First give priority to already existing entities
        foreach ($collection->flatten() as $entity) {
            $master = $this->getOriginal($entity);
            $master->setValue($entity->getValue());
            $master->setFieldtype($entity->getFieldtype());
            $master->handleStorage($this->getFieldType($entity->getFieldname(), $entity->getBlock()));

            $updated[] = $master;
        }

        $deleted = [];
        foreach ($this->flatten() as $old) {
            if (!in_array($old, $updated)) {
                $deleted[] = $old;
            }
        }

        // Clear the collection so that we re-add only the updated elements
        $this->clear();
        foreach ($updated as $new) {
            $this->add($new);
        }

        return $deleted;
    }
5119
private function mergeRootCollection(&$collection, $object)
    {
        if (is_array($object)) {
            foreach ($object as $resource) {
                $this->addResourceToRootCollectionIfNonExistant($collection, $resource);
            }
        } elseif ($object instanceof Collection) {
            $object->each(function ($resource) use (&$collection) {
                $this->addResourceToRootCollectionIfNonExistant($collection, $resource);
            });
        }
    }
826488
public static void copy(Object object, Object clone, String fieldName, boolean ignoreNonExisting)
	{
		invokeSetter(clone, fieldName, invokeGetter(object, fieldName), ignoreNonExisting);
	}
289629
public function setCollection($collection)
    {
        $this->indexedContainer = $collection;

        foreach ($collection as $argModel) {
            $this->hashedContainer[$argModel->getName()] = $argModel;
        }

        return $this;
    }
301900
public function collectionProperties()
    {
        $props = $this->properties();

        foreach ($props as $propertyIdent => $property) {
            $propertyMetadata = $props[$propertyIdent];

            $p = $this->propertyFactory()->create($propertyMetadata['type']);
            $p->setIdent($propertyIdent);
            $p->setData($propertyMetadata);

            $options = $this->viewOptions($propertyIdent);
            $classes = $this->parsePropertyCellClasses($p);

            if (isset($options['label'])) {
                $label = $this->translator()->translate($options['label']);
            } else {
                $label = strval($p->label());
            }

            $column = [
                'label' => trim($label)
            ];

            if (!isset($column['attr'])) {
                $column['attr'] = [];
            }

            if (isset($options['attr'])) {
                $column['attr'] = array_merge($column['attr'], $options['attr']);
            }

            if (isset($classes)) {
                if (isset($column['attr']['class'])) {
                    if (is_string($classes)) {
                        $classes = explode(' ', $column['attr']['class']);
                    }

                    if (is_string($column['attr']['class'])) {
                        $column['attr']['class'] = explode(' ', $column['attr']['class']);
                    }

                    $column['attr']['class'] = array_unique(array_merge($column['attr']['class'], $classes));
                } else {
                    $column['attr']['class'] = $classes;
                }

                unset($classes);
            }

            $column['attr'] = html_build_attributes($column['attr']);

            yield $column;
        }
    }