Sonata admin code:
/**
* {@inheritdoc}
*/
public function batchDelete($class, ProxyQueryInterface $queryProxy)
{
$queryProxy->select('DISTINCT '.$queryProxy->getRootAlias());
try {
$entityManager = $this->getEntityManager($class);
$i = 0;
foreach ($queryProxy->getQuery()->iterate() as $pos => $object) {
$entityManager->remove($object[0]);
if ((++$i % 20) == 0) {
$entityManager->flush();
$entityManager->clear();
}
}
$entityManager->flush();
$entityManager->clear();
} catch (\PDOException $e) {
throw new ModelManagerException('', 0, $e);
} catch (DBALException $e) {
throw new ModelManagerException('', 0, $e);
}
}
понедельник, 7 января 2013 г., 13:36:42 UTC+2 пользователь naitsirch
написал:
>
> Hi doctrine users,
>
> I get this exception "Iterate with fetch join in class Document using
> association categories not allowed." when I execute a query with the
> iterate() method. When I fetch the result with execute() as usual
> everything works fine. Why does this happen? When I remove the line
>
> "throw QueryException::iterateWithFetchJoinNotAllowed($assoc);"
>
> from the SqlWalker, I get the correct result. So what can I do to get the
> query executed correctly?
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.