public function getUrlIdMap(array $urls)
    {
        $map = array();

        if (!empty($urls)) {
            $q = $this->getConnection()->createSelectQuery();
            $q
                ->select('id', 'url')
                ->from(self::URL_TABLE)
                ->where($q->expr->in('url', $urls));

            $statement = $q->prepare();
            $statement->execute();
            foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) {
                $map[$row['url']] = $row['id'];
            }
        }

        return $map;
    }
public function getUrlIdMap(array $urls)
    {
        $map = array();

        if (!empty($urls)) {
            $q = $this->getConnection()->createSelectQuery();
            $q
                ->select('id', 'url')
                ->from(self::URL_TABLE)
                ->where($q->expr->in('url', $urls));

            $statement = $q->prepare();
            $statement->execute();
            foreach ($statement->fetchAll(PDO::FETCH_ASSOC) as $row) {
                $map[$row['url']] = $row['id'];
            }
        }

        return $map;
    }
public function getUrlIdMap ( array $ urls ) { $ map = array ( ) ; if ( ! empty ( $ urls ) ) { $ q = $ this -> getConnection ( ) -> createSelectQuery ( ) ; $ q -> select ( 'id' , 'url' ) -> from ( self :: URL_TABLE ) -> where ( $ q -> expr -> in ( 'url' , $ urls ) ) ; $ statement = $ q -> prepare ( ) ; $ statement -> execute ( ) ; foreach ( $ statement -> fetchAll ( PDO :: FETCH_ASSOC ) as $ row ) { $ map [ $ row [ 'url' ] ] = $ row [ 'id' ] ; } } return $ map ; }
Returns a list of URL ids for a list of URLs.

Non-existent URLs are ignored.

@param string[] $urls An array of URLs

@return array An array of URL ids, with URLs as keys
Returns a list of URL ids for a list of URLs .