$entry = $this->parseEntry($importedEntry);
if (null === $entry) {
- continue;
+ break;
}
// store each entry to be flushed so we can trigger the entry.saved event for each of them
$entryToBeFlushed[] = $entry;
// flush every 20 entries
- if (($i % 20) === 0) {
+ if (0 === ($i % 20)) {
$this->em->flush();
foreach ($entryToBeFlushed as $entry) {