/** * * for each one of the assets and additional entry files check if it was exported to the external storage * and add DeleteStorage job * * @param entry $entry * @param StorageProfile $profile */ public static function deleteExportedEntry(entry $entry, StorageProfile $profile) { $flavorAssets = assetPeer::retrieveFlavorsByEntryIdAndStatus($entry->getId(), null, array(asset::ASSET_STATUS_READY, asset::ASSET_STATUS_EXPORTING)); foreach ($flavorAssets as $flavorAsset) { $key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); if ($profile->isExported($key)) { self::delete($entry, $profile, $key); } $key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ISM); if ($profile->isExported($key)) { self::delete($entry, $profile, $key); } $key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ISMC); if ($profile->isExported($key)) { self::delete($entry, $profile, $key); } } self::deleteAdditionalEntryFilesFromStorage($entry, $profile); }