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

Breadcrumb

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

function AbstractArray::__construct

Constructs a new array object.

Parameters

array<array-key, T> $data The initial items to add to this array.:

8 calls to AbstractArray::__construct()
AbstractMap::__construct in vendor/ramsey/collection/src/Map/AbstractMap.php
AbstractMap::__construct in vendor/ramsey/collection/src/Map/AbstractMap.php
Collection::__construct in vendor/ramsey/collection/src/Collection.php
Constructs a collection object of the specified type, optionally with the specified data.
Collection::__construct in vendor/ramsey/collection/src/Collection.php
Constructs a collection object of the specified type, optionally with the specified data.
Queue::__construct in vendor/ramsey/collection/src/Queue.php
Constructs a queue object of the specified type, optionally with the specified data.

... See full list

4 methods override AbstractArray::__construct()
AbstractMap::__construct in vendor/ramsey/collection/src/Map/AbstractMap.php
Collection::__construct in vendor/ramsey/collection/src/Collection.php
Constructs a collection object of the specified type, optionally with the specified data.
Queue::__construct in vendor/ramsey/collection/src/Queue.php
Constructs a queue object of the specified type, optionally with the specified data.
Set::__construct in vendor/ramsey/collection/src/Set.php
Constructs a set object of the specified type, optionally with the specified data.

File

vendor/ramsey/collection/src/AbstractArray.php, line 43

Class

AbstractArray
This class provides a basic implementation of `ArrayInterface`, to minimize the effort required to implement this interface.

Namespace

Ramsey\Collection

Code

public function __construct(array $data = []) {
    // Invoke offsetSet() for each value added; in this way, sub-classes
    // may provide additional logic about values added to the array object.
    foreach ($data as $key => $value) {
        $this[$key] = $value;
    }
}

API Navigation

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