Loading src/MapObject/MapObject.php +55 −0 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use JsonSerializable; Loading @@ -7,14 +8,68 @@ use JsonSerializable; * Map Object. */ class MapObject implements JsonSerializable { /** * The object id. * * @var string */ protected $id = ''; /** * The entity type. * * @var string */ protected $entityType = ''; /** * The entity id. * * @var string */ protected $entityId = ''; /** * The entity revision id. * * @var string */ protected $entityRevisionId = ''; /** * The entity field delta value. * * @var int */ protected $entityFieldDelta = 0; /** * The object type. * * @var string */ protected $objectType = ''; /** * The object coordinates. * * @var array */ protected $objectCoordinates = []; /** * The object extra parameters. * * @var array */ protected $extraParams = []; /** * The map definition. * * @var array */ protected $map = [ 'map_object_id' => 'id', 'type' => 'objectType', Loading src/MapObject/MapObjectDataMapper.php +2 −1 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use Drupal\Core\Database\Connection; Loading @@ -11,7 +12,7 @@ class MapObjectDataMapper { /** * DBConnections object. * * @var \Drupal\Core\Database\Connection $dbConnection * @var \Drupal\Core\Database\Connection */ protected $dbConnection; Loading src/MapObject/MapObjectService.php +9 −2 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use Drupal\Core\Cache\Cache; Loading @@ -8,17 +9,23 @@ use Drupal\Core\Cache\CacheBackendInterface; * Contains methods to manipulate map objects. */ class MapObjectService { /** * The map object cache key. */ const MAP_OBJECT_CACHE_KEY = 'map_object'; /** * Contains dataMapper object. * * @var \Drupal\map_object_field\MapObject\MapObjectDataMapper $mapObjectDataMapper * @var \Drupal\map_object_field\MapObject\MapObjectDataMapper */ protected $mapObjectDataMapper; /** * Contains cache object. * * @var \Drupal\Core\Cache\CacheBackendInterface $cache * @var \Drupal\Core\Cache\CacheBackendInterface */ protected $cache; Loading Loading
src/MapObject/MapObject.php +55 −0 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use JsonSerializable; Loading @@ -7,14 +8,68 @@ use JsonSerializable; * Map Object. */ class MapObject implements JsonSerializable { /** * The object id. * * @var string */ protected $id = ''; /** * The entity type. * * @var string */ protected $entityType = ''; /** * The entity id. * * @var string */ protected $entityId = ''; /** * The entity revision id. * * @var string */ protected $entityRevisionId = ''; /** * The entity field delta value. * * @var int */ protected $entityFieldDelta = 0; /** * The object type. * * @var string */ protected $objectType = ''; /** * The object coordinates. * * @var array */ protected $objectCoordinates = []; /** * The object extra parameters. * * @var array */ protected $extraParams = []; /** * The map definition. * * @var array */ protected $map = [ 'map_object_id' => 'id', 'type' => 'objectType', Loading
src/MapObject/MapObjectDataMapper.php +2 −1 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use Drupal\Core\Database\Connection; Loading @@ -11,7 +12,7 @@ class MapObjectDataMapper { /** * DBConnections object. * * @var \Drupal\Core\Database\Connection $dbConnection * @var \Drupal\Core\Database\Connection */ protected $dbConnection; Loading
src/MapObject/MapObjectService.php +9 −2 Original line number Diff line number Diff line <?php namespace Drupal\map_object_field\MapObject; use Drupal\Core\Cache\Cache; Loading @@ -8,17 +9,23 @@ use Drupal\Core\Cache\CacheBackendInterface; * Contains methods to manipulate map objects. */ class MapObjectService { /** * The map object cache key. */ const MAP_OBJECT_CACHE_KEY = 'map_object'; /** * Contains dataMapper object. * * @var \Drupal\map_object_field\MapObject\MapObjectDataMapper $mapObjectDataMapper * @var \Drupal\map_object_field\MapObject\MapObjectDataMapper */ protected $mapObjectDataMapper; /** * Contains cache object. * * @var \Drupal\Core\Cache\CacheBackendInterface $cache * @var \Drupal\Core\Cache\CacheBackendInterface */ protected $cache; Loading