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

Breadcrumb

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

function Data::merge

Returns a new Data object containing the entities of $this and $other.

Parameters

\Drupal\jsonapi\JsonApiResource\Data $a: A Data object to be merged.

\Drupal\jsonapi\JsonApiResource\Data $b: A Data object to be merged.

Return value

static A new merged Data object.

File

core/modules/jsonapi/src/JsonApiResource/Data.php, line 154

Class

Data
Represents the `data` and `included` objects of a top-level object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public static function merge(Data $a, Data $b) {
    return new static(array_merge($a->toArray(), $b->toArray()));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal