/**
* Constructor
*
* @param RegistryInterface $registry
* @param string $class
* @param RouterInterface $router
* @param string $routeName
*/
public function __construct(RegistryInterface $registry, $class, RouterInterface $router, $routeName)
{
$tableName = $registry->getManager()->getClassMetadata($class)->table['name'];
$dql = "SELECT p.id as productId, p.slug as slug, p.updated_at as lastmod, 'weekly' as changefreq, '0.5' as priority " . "FROM " . $tableName . " p " . "WHERE p.enabled = 1";
$source = new DoctrineDBALConnectionSourceIterator($registry->getConnection(), $dql);
$this->iterator = new SymfonySitemapSourceIterator($source, $router, $routeName, array('productId' => null, 'slug' => null));
}