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;
    }
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;
    }
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 ; }
Return true if file is in media libray false otherwise.

@param \BackBee\ClassContent\Element\File $file

@return boolean
Return true if file is in media libray false otherwise .