Skip to content
Snippets Groups Projects

Add the build_array process plugin

1 unresolved thread

Closes #3440904

Merge request reports

Checking pipeline status.

Approval is optional

Merged by Lucas HeddingLucas Hedding 5 months ago (Nov 20, 2024 4:45pm UTC)

Merge details

  • Changes merged into 6.0.x with d2c5eba3 (commits were squashed).
  • Did not delete the source branch.

Pipeline passed with warnings for d2c5eba3 on 6.0.x

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 66 * @MigrateProcessPlugin(id = "array_template")
    67 */
    68 final class ArrayTemplate extends ProcessPluginBase {
    69
    70 /**
    71 * {@inheritdoc}
    72 */
    73 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property): array {
    74 $template = $this->configuration['template'] ?? NULL;
    75 if (!is_array($template)) {
    76 throw new \InvalidArgumentException('The "template" must be set to an array.');
    77 }
    78
    79 $args = ['row' => $row, 'pipeline' => $value];
    80 if (!array_walk_recursive($template, [$this, 'process'], $args)) {
    81 throw new MigrateException('There was a problem processing the template.');
  • Dan Flanagan
  • Dan Flanagan
  • Dan Flanagan
  • Benji Fisher added 16 commits

    added 16 commits

    Compare with previous version

  • Benji Fisher added 3 commits

    added 3 commits

    • b5ebbc30 - Fix an indentation error in sample code
    • 17755823 - Remove unnecessary test
    • e165e279 - Check the template in the constructor, not transform()

    Compare with previous version

  • Please register or sign in to reply
    Loading