/** * * Sets the default thumb for the assets * If others already exists then we don't set the asset as not default * @param thumbAsset $thumbAsset */ protected static function setIsDefaultThumb(thumbAsset $thumbAsset) { $entryThumbAssets = assetPeer::retrieveThumbnailsByEntryId($thumbAsset->getEntryId()); foreach ($entryThumbAssets as $entryThumbAsset) { //if we found another asset with a defualt tag. we remove our default tag if ($entryThumbAsset->getId() !== $thumbAsset->getId() && $entryThumbAsset->hasTag(thumbParams::TAG_DEFAULT_THUMB)) { KalturaLog::debug("Found default tag on thumbAsset id[" . $entryThumbAsset->getId() . "]"); $thumbAsset->removeTags(array(thumbParams::TAG_DEFAULT_THUMB)); KalturaLog::debug("Removed default tag from thumbAsset id[" . $thumbAsset->getId() . "]"); return; } } }