Skip to content

Commit

Permalink
use data product from line instead of full line item
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Apr 29, 2024
1 parent 1a0e49e commit 235e8d7
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Capacity/Loader/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,8 @@ public function getBuilder(array $config): Builder
$builder = (new Akeneo\Builder\Capacity\Loader\Create())
->withEndpoint(endpoint: new Node\Identifier(sprintf('get%sApi', ucfirst((string) $config['type']))))
->withCode(code: compileValueWhenExpression($this->interpreter, $config['code'], 'line'))
->withData(line: new Node\Expr\Variable('line'))
->withData(line: new Node\Expr\Variable('line["product"]'))
;

if (\array_key_exists('reference_entity', $config)) {
$builder->withReferenceEntity(referenceEntity: new Node\Scalar\String_($config['reference_entity']));
}

if (\array_key_exists('reference_entity_attribute', $config)) {
$builder->withReferenceEntityAttribute(referenceEntityAttribute: compileValueWhenExpression($this->interpreter, $config['reference_entity_attribute'], 'line'));
}

return $builder;
}
}

0 comments on commit 235e8d7

Please sign in to comment.