mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-06-30 08:29:23 +02:00
typo and updated the if conditions
This commit is contained in:
parent
29be1bc504
commit
c5388b6e5b
|
@ -145,7 +145,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
|
||||||
$list = new ArrayList();
|
$list = new ArrayList();
|
||||||
|
|
||||||
foreach ($this->owner->hasOne() as $field => $type) {
|
foreach ($this->owner->hasOne() as $field => $type) {
|
||||||
if(is_a(singleton($type), 'Image')) {
|
if (singleton($type) instanceof Image) {
|
||||||
$image = $this->owner->getComponent($field);
|
$image = $this->owner->getComponent($field);
|
||||||
if ($image && $image->exists()) {
|
if ($image && $image->exists()) {
|
||||||
$list->push($image);
|
$list->push($image);
|
||||||
|
@ -153,7 +153,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($this->owner->hasMany() as $field => $type) {
|
foreach ($this->owner->hasMany() as $field => $type) {
|
||||||
if(is_a(singleton($type), 'Image')) {
|
if (singleton($type) instanceof Image) {
|
||||||
$images = $this->owner->getComponents($field);
|
$images = $this->owner->getComponents($field);
|
||||||
foreach ($images as $image) {
|
foreach ($images as $image) {
|
||||||
if ($image && $image->exists()) {
|
if ($image && $image->exists()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user