/** * @param flavorAsset $flavorAsset * @return boolean true if the given flavor asset is configured to be exported or false otherwise */ public function shouldExportFlavorAsset(flavorAsset $flavorAsset) { $shouldExport = null; // check if flavor params id is in the list to export $flavorParamsIdsToExport = $this->getFlavorParamsIds(); KalturaLog::log(__METHOD__ . " flavorParamsIds [{$flavorParamsIdsToExport}]"); if (is_null($flavorParamsIdsToExport) || strlen(trim($flavorParamsIdsToExport)) == 0) { // all flavor assets should be exported $shouldExport = true; } else { $flavorParamsIdsToExport = array_map('trim', explode(',', $flavorParamsIdsToExport)); if (in_array($flavorAsset->getFlavorParamsId(), $flavorParamsIdsToExport)) { // flavor set to export $shouldExport = true; } else { // flavor not set to export $shouldExport = false; } } // check if flavor fits the export rules defined on the profile if ($shouldExport) { $key = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET); $shouldExport = kStorageExporter::shouldExport($key, $this); if (!$shouldExport) { KalturaLog::log("no need to export key [{$key}] to externalStorage id[" . $this->getId() . "]"); } } return $shouldExport; }