mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 11:05:48 +02:00
Added support for versioned dataobjects
This commit is contained in:
parent
5f26b65061
commit
997f75ae22
@ -202,6 +202,15 @@ class GoogleSitemap {
|
||||
|
||||
return $output;
|
||||
}
|
||||
else if (Object::has_extension($class, 'Versioned')) {
|
||||
$table = singleton($class)->baseTable() . '_Live';
|
||||
if (DB::getConn()->hasTable($table)) {
|
||||
$instances = Versioned::get_by_stage($class, 'Live');
|
||||
}
|
||||
else {
|
||||
$instances = DataObject::get($class)->byID($id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$instances = new DataList($class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user