<?php
$protocolRepository = $doctrine->getRepository('Protocol');
$userRepository = $doctrine->getRepository('User');
$statisticVoteRepository = $doctrine->getRepository('StatisticVote');
while(true) {
$em = $doctrine->getManager();
$users = $userRepository->findAll();
/** @var \SIP\ResourceBundle\Entity\User\User $user */
foreach ($users as $user) {
$svqb = $statisticVoteRepository->createQueryBuilder('v')
// ->leftJoin('v.users', 'u')
->where('v.user = :user')->setParameter('user', $user)
;
///////////////////////////////////////////////
PD9waHAKCiRwcm90b2NvbFJlcG9zaXRvcnkgPSAkZG9jdHJpbmUtPmdldFJlcG9zaXRvcnkoJ1Byb3RvY29sJyk7CiR1c2VyUmVwb3NpdG9yeSA9ICRkb2N0cmluZS0+Z2V0UmVwb3NpdG9yeSgnVXNlcicpOwokc3RhdGlzdGljVm90ZVJlcG9zaXRvcnkgPSAkZG9jdHJpbmUtPmdldFJlcG9zaXRvcnkoJ1N0YXRpc3RpY1ZvdGUnKTsKCndoaWxlKHRydWUpIHsKICAgICRlbSA9ICRkb2N0cmluZS0+Z2V0TWFuYWdlcigpOwogICAgJHVzZXJzID0gJHVzZXJSZXBvc2l0b3J5LT5maW5kQWxsKCk7CgogICAgLyoqIEB2YXIgXFNJUFxSZXNvdXJjZUJ1bmRsZVxFbnRpdHlcVXNlclxVc2VyICR1c2VyICovCiAgICBmb3JlYWNoICgkdXNlcnMgYXMgJHVzZXIpIHsKCiAgICAgICAgJHN2cWIgPSAkc3RhdGlzdGljVm90ZVJlcG9zaXRvcnktPmNyZWF0ZVF1ZXJ5QnVpbGRlcigndicpCi8vICAgICAgICAgICAgLT5sZWZ0Sm9pbigndi51c2VycycsICd1JykKICAgICAgICAgICAgIC0+d2hlcmUoJ3YudXNlciA9IDp1c2VyJyktPnNldFBhcmFtZXRlcigndXNlcicsICR1c2VyKQogICAgICAgIDsKICAgICAgICAKICAgICAgICAKICAgICAgICAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLw==