Skip to content

Batch process when too many notifications #2

@Sydney-o9

Description

@Sydney-o9

Batch Processing in Doctrine

$q = $this->_em->createQuery('select n from merkNotificationBundle\Model\Notification n');
$iterableResult = $q->iterate();
foreach ($iterableResult AS $row) {
    // do stuff with the data in the row, $row[0] is always the object

    // detach from Doctrine, so that it can be Garbage-Collected immediately
    $this->_em->detach($row[0]);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions