Skip to content

Commit

Permalink
Geopoint field returning null #352
Browse files Browse the repository at this point in the history
  • Loading branch information
weisswurstkanone committed May 10, 2021
1 parent 50ed9ce commit 342ce49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/GraphQL/Resolver/Geopoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use GraphQL\Type\Definition\ResolveInfo;
use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait;
use Pimcore\Model\DataObject\Data\GeoCoordinates;

class Geopoint
{
Expand All @@ -35,6 +36,7 @@ class Geopoint
public function resolveLongitude($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
// cannot be changed to GeoCoordinates due to BC reasons
@class_alias(GeoCoordinates::class, 'Pimcore\Model\DataObject\Data\Geopoint');
if ($value instanceof \Pimcore\Model\DataObject\Data\Geopoint) {
return $value->getLongitude();
}
Expand All @@ -55,6 +57,7 @@ public function resolveLongitude($value = null, $args = [], $context = [], Resol
public function resolveLatitude($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null)
{
// cannot be changed to GeoCoordinates due to BC reasons
@class_alias(GeoCoordinates::class, 'Pimcore\Model\DataObject\Data\Geopoint');
if ($value instanceof \Pimcore\Model\DataObject\Data\Geopoint) {
return $value->getLatitude();
}
Expand Down

0 comments on commit 342ce49

Please sign in to comment.