function Row::__construct
Same name and namespace in other branches
- 11.x core/modules/migrate/src/Row.php \Drupal\migrate\Row::__construct()
- 10 core/modules/migrate/src/Row.php \Drupal\migrate\Row::__construct()
- 9 core/modules/migrate/src/Row.php \Drupal\migrate\Row::__construct()
- 8.9.x core/modules/migrate/src/Row.php \Drupal\migrate\Row::__construct()
Constructs a \Drupal\migrate\Row object.
Parameters
array $source: An array of values to add as properties on the object.
array $sourceIds: An array containing the IDs of the source using the keys as the field names.
bool $isStub: 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 80
Class
- Row
- Stores a row.
Namespace
Drupal\migrateCode
public function __construct(protected array $source = [], protected array $sourceIds = [], protected $isStub = FALSE) {
foreach (array_keys($this->sourceIds) as $id) {
if (!$this->hasSourceProperty($id)) {
throw new \InvalidArgumentException("'{$id}' is defined as a source ID but has no value.");
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.