Skip to content

Commit

Permalink
Added Closure interface to BranchingLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Jan 28, 2024
1 parent 6790bc0 commit e97aeec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/etl/src/Flow/ETL/Loader/BranchingLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@
use Flow\ETL\Rows;
use Flow\ETL\Transformer\ScalarFunctionFilterTransformer;

final class BranchingLoader implements Loader, OverridingLoader
final class BranchingLoader implements Closure, Loader, OverridingLoader
{
public function __construct(
private readonly ScalarFunction $condition,
private readonly Loader $loader
) {
}

public function closure(FlowContext $context) : void
{
if ($this->loader instanceof Closure) {
$this->loader->closure($context);
}
}

public function load(Rows $rows, FlowContext $context) : void
{
$this->loader->load(
Expand Down

0 comments on commit e97aeec

Please sign in to comment.