typo and updated the if conditions

This commit is contained in:
Nivanka Fonseka 2017-07-27 08:46:17 +05:30 committed by Daniel Hensby
parent 29be1bc504
commit c5388b6e5b
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -145,7 +145,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
$list = new ArrayList();
foreach ($this->owner->hasOne() as $field => $type) {
if(is_a(singleton($type), 'Image')) {
if (singleton($type) instanceof Image) {
$image = $this->owner->getComponent($field);
if ($image && $image->exists()) {
$list->push($image);
@ -153,7 +153,7 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
}
}
foreach ($this->owner->hasMany() as $field => $type) {
if(is_a(singleton($type), 'Image')) {
if (singleton($type) instanceof Image) {
$images = $this->owner->getComponents($field);
foreach ($images as $image) {
if ($image && $image->exists()) {