src/Entity/TweetRepository.php
private function removeOrphanMedias(Media $media)
    {
        if (count($media->getTweets()) == 0) {
            $this->_em->remove($media);
        }
    }
private function removeOrphanMedias(Media $media)
    {
        if (count($media->getTweets()) == 0) {
            $this->_em->remove($media);
        }
    }
private function removeOrphanMedias ( Media $ media ) { if ( count ( $ media -> getTweets ( ) ) == 0 ) { $ this -> _em -> remove ( $ media ) ; } }
Remove Media not associated to any Tweet.

@param Media $media
Remove Media not associated to any Tweet .