Sonata\Component\Product\SeoProductIterator::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Symfony\Bridge\Doctrine\RegistryInterface $registry, string $class, Symfony\Component\Routing\RouterInterface $router, string $routeName )
$registry Symfony\Bridge\Doctrine\RegistryInterface
$class string
$router Symfony\Component\Routing\RouterInterface
$routeName string
    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));
    }