function Action::prepareRow

Same name in other branches
  1. 9 core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action::prepareRow()
  2. 8.9.x core/modules/action/src/Plugin/migrate/source/Action.php \Drupal\action\Plugin\migrate\source\Action::prepareRow()
  3. 11.x core/modules/system/src/Plugin/migrate/source/Action.php \Drupal\system\Plugin\migrate\source\Action::prepareRow()

Overrides SourcePluginBase::prepareRow

File

core/modules/system/src/Plugin/migrate/source/Action.php, line 56

Class

Action
Drupal action source from database.

Namespace

Drupal\system\Plugin\migrate\source

Code

public function prepareRow(Row $row) {
    $aid = $row->getSourceProperty('aid');
    if (is_numeric($aid)) {
        if ($this->getModuleSchemaVersion('system') >= 7000) {
            $label = $row->getSourceProperty('label');
        }
        else {
            $label = $row->getSourceProperty('description');
        }
        $row->setSourceProperty('aid', $label);
    }
    return parent::prepareRow($row);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.