protected function getSitemapEntries(ProfileInterface $profile)
    {
        $now = new \DateTime();
        $urlEntries = $profile->getUrlEntries();
        $numberOfSitemap = $this->getNumberOfSitemap($urlEntries);

        if (1 === $numberOfSitemap) {
            $this->writeFile(
                $this->helper->getSitemapEntryFilePath($this->getFilename($profile)),
                $this->render->renderSitemap($urlEntries)
            );

            return array(new SitemapEntry($this->helper->getSitemapEntryFileUrl($this->getFilename($profile)), $now));
        }


        $sitemapEntries = array();

        for ($number = 0; $number < $numberOfSitemap; $number++) {
            $filename = $this->getFilename($profile, $number);
            $entries = array_slice($urlEntries, $number * $this->maxPerSitemap, $this->maxPerSitemap);

            $this->writeFile($this->helper->getSitemapEntryFilePath($filename), $this->render->renderSitemap($entries));

            $sitemapEntries[] = new SitemapEntry($this->helper->getSitemapEntryFileUrl($filename), $now);
        }

        return $sitemapEntries;
    }