mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
Fix latest merge
This commit is contained in:
@@ -58,23 +58,14 @@ class patch_386alpha4a implements patchInterface
|
||||
*/
|
||||
public function apply(base $appbox, Application $app)
|
||||
{
|
||||
$sql = 'SELECT usr_id FROM usr WHERE usr_login LIKE "(#deleted_%"';
|
||||
$stmt = $appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
|
||||
$repo = $app['EM']->getRepository('Entities\UsrList');
|
||||
|
||||
$users = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
foreach ($users as $user) {
|
||||
foreach ($repo->findUserLists(new \User_Adapter($user['usr_id'], $app)) as $list) {
|
||||
$repo = $app['EM']->getRepository('Phraseanet:UsrList');
|
||||
foreach ($app['EM']->getRepository('Phraseanet:User')->findDeleted() as $user) {
|
||||
foreach ($repo->findUserLists($user) as $list) {
|
||||
$app['EM']->remove($list);
|
||||
}
|
||||
$app['EM']->flush();
|
||||
}
|
||||
|
||||
$stmt->closeCursor();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user