public function Accordionblock::prepareRow in Accordion Blocks 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/ Accordionblock.php, line 55
Class
- Accordionblock
- Accordion block source from database
Namespace
Drupal\accordion_blocks\Plugin\migrate\sourceCode
public function prepareRow(Row $row) {
$content = unserialize($row
->getSourceProperty('content'));
$blocks_content = [];
if (isset($content)) {
foreach ($content as $key => $block) {
if (!empty($block)) {
list($module, $delta) = explode('_delta_', $block);
$block_id = $this
->_getBlockId($module, $delta);
//$block_id = $this->defaultTheme. "_".$module."_".$delta;
$blocks_content[] = $block_id;
}
}
}
$row
->setSourceProperty('content', $blocks_content);
return parent::prepareRow($row);
}