Automattic\WooCommerce\EmailEditorVendor\Pelago\Emogrifier\Utilities

ArrayIntersector::intersectWith │ public │ WC 1.0

Computes the intersection of $array and the array with which this object was constructed.

Метод класса: ArrayIntersector{}

Хуков нет.

Возвращает

array<array-key, array-key>. Returns an array containing all of the values in $array whose values exist in the array with which this object was constructed. Note that keys are preserved, order is maintained, but duplicates are removed.

Использование

$ArrayIntersector = new ArrayIntersector();
$ArrayIntersector->intersectWith( $array ): array;
$array(array<array-key, array-key>) (обязательный)
.

Код ArrayIntersector::intersectWith() WC 11.3.0

public function intersectWith(array $array): array
{
    $invertedArray = \array_flip($array);

    $invertedIntersection = \array_intersect_key($invertedArray, $this->invertedArray);

    return \array_flip($invertedIntersection);
}