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

Breadcrumb

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

function Row::__construct

Constructs a \Drupal\migrate\Row object.

Parameters

array $values: An array of values to add as properties on the object.

array $source_ids: An array containing the IDs of the source using the keys as the field names.

bool $is_stub: TRUE if the row being created is a stub.

Throws

\InvalidArgumentException Thrown when a source ID property does not exist.

File

core/modules/migrate/src/Row.php, line 101

Class

Row
Stores a row.

Namespace

Drupal\migrate

Code

public function __construct(array $values = [], array $source_ids = [], $is_stub = FALSE) {
    $this->source = $values;
    $this->sourceIds = $source_ids;
    $this->isStub = $is_stub;
    foreach (array_keys($source_ids) as $id) {
        if (!$this->hasSourceProperty($id)) {
            throw new \InvalidArgumentException("'{$id}' is defined as a source ID but has no value.");
        }
    }
}

API Navigation

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