You are here

public function Row::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Row.php \Drupal\migrate\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 99
Contains \Drupal\migrate\Row.

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} has no value");
    }
  }
}