getWrongVersionedDocuments example

#[Package('core')] class Migration1612442786ChangeVersionOfDocuments extends MigrationStep
{
    public function getCreationTimestamp(): int
    {
        return 1612442786;
    }

    public function update(Connection $connection): void
    {
        /** Get all documents with live version */
        $wrongVersionedDocuments = $this->getWrongVersionedDocuments($connection);

        foreach ($wrongVersionedDocuments as $wrongVersionedDocument) {
            /** get the order version which was created nearest before the document creation */
            $orders = $this->getOrders(
                $connection,
                $wrongVersionedDocument['order_id'],
                $wrongVersionedDocument['created_at']
            );

            if (\is_array($orders) && \count($orders) === 1) {
                /* Update the document version with the version of the order */
                
Home | Imprint | This part of the site doesn't use cookies.