Switch to FtpExport entities

This commit is contained in:
Romain Neutron
2013-08-29 18:47:26 +02:00
parent 17a4f1970a
commit 9804e3b4c3
12 changed files with 373 additions and 350 deletions

View File

@@ -759,10 +759,14 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
public function delete()
{
$repo = $this->app['EM']->getRepository('Entities\UsrAuthProvider');
foreach ($repo->findByUser($this) as $provider) {
$this->app['EM']->remove($provider);
}
$repo = $this->app['EM']->getRepository('Entities\FtpExport');
foreach ($repo->findByUser($this) as $export) {
$this->app['EM']->remove($export);
}
$this->app['EM']->flush();
@@ -792,11 +796,6 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
$stmt->execute(array(':usr_id' => $this->get_id()));
$stmt->closeCursor();
$sql = 'DELETE FROM ftp_export WHERE usr_id = :usr_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(array(':usr_id' => $this->get_id()));
$stmt->closeCursor();
$sql = 'DELETE FROM `order` WHERE usr_id = :usr_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute(array(':usr_id' => $this->get_id()));