Merge pull request #174 from wilr/pr/172
Handle cases such as 'Class.RelationName'
This commit is contained in:
commit
56b25a424f
|
@ -162,12 +162,16 @@ class GoogleSitemapSiteTreeExtension extends GoogleSitemapExtension
|
||||||
|
|
||||||
foreach ($this->owner->manyMany() as $field => $type) {
|
foreach ($this->owner->manyMany() as $field => $type) {
|
||||||
$image = false;
|
$image = false;
|
||||||
|
|
||||||
if (is_array($type) && isset($type['through'])) {
|
if (is_array($type) && isset($type['through'])) {
|
||||||
if (singleton($type['through']) instanceof Image) {
|
if (singleton($type['through']) instanceof Image) {
|
||||||
$image = true;
|
$image = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (strpos($type, '.') !== false) {
|
||||||
|
$type = explode('.', $type)[0];
|
||||||
|
}
|
||||||
|
|
||||||
if (singleton($type) instanceof Image) {
|
if (singleton($type) instanceof Image) {
|
||||||
$image = true;
|
$image = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue