private function cleanTranslations(MediaInterface $media)
    {
        foreach ($media->getTranslations() as $trans) {
            if (0 == strlen($trans->getTitle()) && 0 == strlen($trans->getDescription())) {
                $media->removeTranslation($trans);
            }
        }
    }
private function cleanTranslations(MediaInterface $media)
    {
        foreach ($media->getTranslations() as $trans) {
            if (0 == strlen($trans->getTitle()) && 0 == strlen($trans->getDescription())) {
                $media->removeTranslation($trans);
            }
        }
    }
private function cleanTranslations ( MediaInterface $ media ) { foreach ( $ media -> getTranslations ( ) as $ trans ) { if ( 0 == strlen ( $ trans -> getTitle ( ) ) && 0 == strlen ( $ trans -> getDescription ( ) ) ) { $ media -> removeTranslation ( $ trans ) ; } } }
Removes empty translations

@param MediaInterface $media
Removes empty translations