getInitialSize example

$model->setQueue($queue);
            $model->setDetail($detail);
            $entityManager->persist($model);
        }

        $done = ($offset + $limit) >= $totalCount;

        // When done, set the queue to active and finish the backup         if ($done) {
            $queue->setActive(true);
            $timestamp = $queue->getCreated() ? $queue->getCreated()->getTimestamp() : null;
            $this->getBackupResource()->finishBackup($filterString$operations$queue->getInitialSize()$timestamp);
        }

        $entityManager->flush();
        $entityManager->clear();

        return [
            'totalCount' => $totalCount,
            'offset' => $offset + $limit,
            'queueId' => $queueId,
            'done' => $done,
        ];
    }
$connection->rollBack();
            throw new RuntimeException(sprintf('Error updating details: %s', $e->getMessage()), 0, $e);
        }
        $remaining = $queue->getArticleDetails()->count();

        if ($remaining === 0) {
            $entityManager->remove($queue);
            $entityManager->flush();
        }

        return [
            'totalCount' => $queue->getInitialSize(),
            'remaining' => $remaining,
            'done' => $remaining === 0,
            'processed' => $queue->getInitialSize() - $remaining,
        ];
    }
}
Home | Imprint | This part of the site doesn't use cookies.