Commit 563aa0f3 authored by Serg Prodan's avatar Serg Prodan Committed by Yaroslav Samoilenko
Browse files

Issue #2948261 by drupalgin, Indra patil, ysamoylenko: Fixed coding standards step 3 (MapObject)

parent fecfede1
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\map_object_field\MapObject;

use JsonSerializable;
@@ -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',
+2 −1
Original line number Diff line number Diff line
<?php

namespace Drupal\map_object_field\MapObject;

use Drupal\Core\Database\Connection;
@@ -11,7 +12,7 @@ class MapObjectDataMapper {
  /**
   * DBConnections object.
   *
   * @var \Drupal\Core\Database\Connection $dbConnection
   * @var \Drupal\Core\Database\Connection
   */
  protected $dbConnection;

+9 −2
Original line number Diff line number Diff line
<?php

namespace Drupal\map_object_field\MapObject;

use Drupal\Core\Cache\Cache;
@@ -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;