eZ\Publish\Core\FieldType\Url\UrlStorage\Gateway\LegacyStorage::getUrlIdMap PHP Method

getUrlIdMap() public method

Non-existent URLs are ignored.
public getUrlIdMap ( array $urls ) : array
$urls array An array of URLs
return array An array of URL ids, with URLs as keys
    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;
    }