mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
fix: cast variables (#192)
This commit is contained in:
parent
523d196d12
commit
def6be347c
@ -236,7 +236,8 @@ class GoogleSitemap
|
|||||||
*/
|
*/
|
||||||
public function getItems($class, $page = 1)
|
public function getItems($class, $page = 1)
|
||||||
{
|
{
|
||||||
//normalise the class name
|
$page = (int) $page;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$reflectionClass = new ReflectionClass($class);
|
$reflectionClass = new ReflectionClass($class);
|
||||||
$class = $reflectionClass->getName();
|
$class = $reflectionClass->getName();
|
||||||
@ -246,7 +247,7 @@ class GoogleSitemap
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output = new ArrayList();
|
$output = new ArrayList();
|
||||||
$count = Config::inst()->get(__CLASS__, 'objects_per_sitemap');
|
$count = (int) Config::inst()->get(__CLASS__, 'objects_per_sitemap');
|
||||||
$filter = Config::inst()->get(__CLASS__, 'use_show_in_search');
|
$filter = Config::inst()->get(__CLASS__, 'use_show_in_search');
|
||||||
$redirector = Config::inst()->get(__CLASS__, 'exclude_redirector_pages');
|
$redirector = Config::inst()->get(__CLASS__, 'exclude_redirector_pages');
|
||||||
|
|
||||||
@ -416,7 +417,7 @@ class GoogleSitemap
|
|||||||
->limit($countPerFile, ($i - 1) * $countPerFile)
|
->limit($countPerFile, ($i - 1) * $countPerFile)
|
||||||
->last();
|
->last();
|
||||||
|
|
||||||
$lastModified = ($sliced) ? date('Y-m-d', strtotime($sliced->LastEdited)): date('Y-m-d');
|
$lastModified = ($sliced) ? date('Y-m-d', strtotime($sliced->LastEdited)) : date('Y-m-d');
|
||||||
|
|
||||||
$sitemaps->push(new ArrayData(array(
|
$sitemaps->push(new ArrayData(array(
|
||||||
'ClassName' => $this->sanitiseClassName($class),
|
'ClassName' => $this->sanitiseClassName($class),
|
||||||
|
Loading…
Reference in New Issue
Block a user