public function isInMediaLibrary(ElementFile $file)
    {
        $parent_ids = $this->getParentContentUid($file);
        if (0 === count($parent_ids)) {
            return false;
        }

        $q = $this->_em->getConnection()
                ->createQueryBuilder()
                ->select('m.id')
                ->from('media', 'm')
                ->andWhere('m.content_uid IN ("'.implode('","', $parent_ids).'")');

        $medias = $q->execute()->fetchAll(\PDO::FETCH_COLUMN);

        return (0 < count($medias)) ? $medias[0] : false;
    }