You are here

public function EckEntityType::prepareRow in Entity Construction Kit (ECK) 8

Adds additional data to the row.

Parameters

\Drupal\migrate\Row $row: The row object.

Return value

bool FALSE if this row needs to be skipped.

Overrides SourcePluginBase::prepareRow

File

src/Plugin/migrate/source/d7/EckEntityType.php, line 34

Class

EckEntityType
Drupal 7 ECK Entity types source from database.

Namespace

Drupal\eck\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {

  // Properties array is JSON encoded, so we need to decode it.
  $properties = Json::decode($row
    ->getSourceProperty('properties'));
  foreach ($properties as $key => $property) {

    // We take advantage of the fact that the properties key corresponds to
    // the Drupal 8 eck.eck_entity_type properties.
    // Value is not important, as the choice is between enabled or not, and
    // only enabled values are present in the properties array.
    $row
      ->setSourceProperty($key, TRUE);
  }
  return parent::prepareRow($row);
}