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

        if (!empty($urls)) {
            $query = $this->connection->createQueryBuilder();
            $query
                ->select(
                    $this->connection->quoteIdentifier('id'),
                    $this->connection->quoteIdentifier('url')
                )
                ->from(self::URL_TABLE)
                ->where(
                    $query->expr()->in('url', ':urls')
                )
                ->setParameter(':urls', $urls, Connection::PARAM_STR_ARRAY);

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

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

        if (!empty($urls)) {
            $query = $this->connection->createQueryBuilder();
            $query
                ->select(
                    $this->connection->quoteIdentifier('id'),
                    $this->connection->quoteIdentifier('url')
                )
                ->from(self::URL_TABLE)
                ->where(
                    $query->expr()->in('url', ':urls')
                )
                ->setParameter(':urls', $urls, Connection::PARAM_STR_ARRAY);

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

        return $map;
    }
public function getUrlIdMap ( array $ urls ) { $ map = [ ] ; if ( ! empty ( $ urls ) ) { $ query = $ this -> connection -> createQueryBuilder ( ) ; $ query -> select ( $ this -> connection -> quoteIdentifier ( 'id' ) , $ this -> connection -> quoteIdentifier ( 'url' ) ) -> from ( self :: URL_TABLE ) -> where ( $ query -> expr ( ) -> in ( 'url' , ':urls' ) ) -> setParameter ( ':urls' , $ urls , Connection :: PARAM_STR_ARRAY ) ; $ statement = $ query -> execute ( ) ; foreach ( $ statement -> fetchAll ( PDO :: FETCH_ASSOC ) as $ row ) { $ map [ $ row [ 'url' ] ] = $ row [ 'id' ] ; } } return $ map ; }
Return 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
Return a list of URL ids for a list of URLs .