public function supports(string
$type): bool
{ return $type === LineItem::CUSTOM_LINE_ITEM_TYPE;
} /**
* @param array<mixed> $data
*/
public function create(array
$data, SalesChannelContext
$context): LineItem
{ if (!
$context->
hasPermission(ProductCartProcessor::ALLOW_PRODUCT_PRICE_OVERWRITES
)) { throw CartException::
insufficientPermission();
} $lineItem =
new LineItem($data['id'
],
$data['type'
],
$data['referencedId'
] ?? null,
$data['quantity'
] ?? 1
);
$lineItem->
markModified();
$this->
update($lineItem,
$data,
$context);
return $lineItem;
} /**
* @param array<mixed> $data
*/