mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
PHRAS-3604 remove deleted record from a publication
This commit is contained in:
@@ -32,6 +32,7 @@ use Alchemy\Phrasea\Media\TechnicalData;
|
||||
use Alchemy\Phrasea\Media\TechnicalDataSet;
|
||||
use Alchemy\Phrasea\Metadata\Tag\TfBasename;
|
||||
use Alchemy\Phrasea\Metadata\Tag\TfFilename;
|
||||
use Alchemy\Phrasea\Model\Repositories\FeedItemRepository;
|
||||
use Alchemy\Phrasea\Model\Entities\OrderElement;
|
||||
use Alchemy\Phrasea\Model\Entities\User;
|
||||
use Alchemy\Phrasea\Model\RecordInterface;
|
||||
@@ -2146,6 +2147,14 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
$this->app['orm.em']->remove($basket_element);
|
||||
}
|
||||
|
||||
/** @var FeedItemRepository $feedItemRepository */
|
||||
$feedItemRepository = $this->app['repo.feed-items'];
|
||||
|
||||
// remove the record from publications
|
||||
foreach($feedItemRepository->findBy(['recordId' => $this->getRecordId()]) as $feedItem) {
|
||||
$this->app['orm.em']->remove($feedItem);
|
||||
}
|
||||
|
||||
$this->app['orm.em']->flush();
|
||||
|
||||
$this->app['filesystem']->remove($ftodel);
|
||||
|
Reference in New Issue
Block a user