2
0
forked from Wavyzz/dolibarr

Merge pull request #31419 from frederic34/extrafields_object_filter

can filter on object properties
This commit is contained in:
Laurent Destailleur
2025-02-19 18:33:03 +01:00
committed by GitHub
4 changed files with 591 additions and 199 deletions

View File

@@ -1585,16 +1585,16 @@ function dol_get_object_properties($obj, $properties = [])
/**
* Create a clone of instance of object (new instance with same value for each properties)
* Create a clone of instance of object (new instance with same value for each properties)
* With native = 0: Property that are references are different memory area in the new object (full isolation clone). This means $this->object of new object may not be valid (except this->db that is voluntarly kept).
* With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object.
* With native = 2: Property that are reference are different memory area in the new object (full isolation clone). Only scalar and array values are cloned. This means method are not availables and $this->db of new object is not valid.
*
* @template T
*
* @param T $object Object to clone
* @param T $object Object to clone
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended)
* @return T Clone object
* @return T Clone object
*
* @see https://php.net/manual/language.oop5.cloning.php
* @phan-suppress PhanTypeExpectedObjectPropAccess