'joinTable' => '`order_customer`',
'joinAlias' => '`order.orderCustomer`',
'joinCondition' => '`order`.`id` = `order.orderCustomer`.`order_id` AND `order`.`version_id` = `order.orderCustomer`.`order_version_id`',
],
],
],
$this->queryBuilder->
getQueryPart('join'
));
} public function testCorrectOrderVersionOverAssociationOverRepositorySearch(): void
{ // 1. Create a new order and extract order number
$cart =
$this->
generateDemoCart(2
);
$orderId =
$this->
persistCart($cart);
/** @var OrderEntity $order */
$order =
$this->orderRepository->
search(new Criteria([$orderId]),
$this->context
)->
first();
// 2. Generate a document attached to the order
$this->
createDocument('invoice',
$orderId,
[],
$this->context
);
// 3. Set created order version to be lexicographically smaller than the live version
$this->connection->
executeStatement( 'UPDATE `order`
SET `version_id` = :newVersionId
WHERE `version_id` != :liveVersionId AND `id` = :orderId',