You are here

interface JsonapiHelperInterface in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/src/Service/JsonapiHelperInterface.php \Drupal\entity_share_client\Service\JsonapiHelperInterface
  2. 8 modules/entity_share_client/src/Service/JsonapiHelperInterface.php \Drupal\entity_share_client\Service\JsonapiHelperInterface

Jsonapi helper interface methods.

Hierarchy

Expanded class hierarchy of JsonapiHelperInterface

All classes that implement JsonapiHelperInterface

3 files declare their use of JsonapiHelperInterface
BlockFieldBlockContentImporter.php in modules/entity_share_client/src/EventSubscriber/BlockFieldBlockContentImporter.php
EntityShareAsyncWorker.php in modules/entity_share_async/src/Plugin/QueueWorker/EntityShareAsyncWorker.php
PullForm.php in modules/entity_share_client/src/Form/PullForm.php

File

modules/entity_share_client/src/Service/JsonapiHelperInterface.php, line 13

Namespace

Drupal\entity_share_client\Service
View source
interface JsonapiHelperInterface {

  /**
   * Prepare entities from an URI to request.
   *
   * @param array $json_data
   *   An array of data send by the JSON:API.
   * @param \Drupal\entity_share_client\Entity\RemoteInterface $remote
   *   The selected remote.
   * @param string $channel_id
   *   The selected channel id.
   *
   * @return array
   *   The array of options for the tableselect form type element.
   */
  public function buildEntitiesOptions(array $json_data, RemoteInterface $remote, $channel_id);

  /**
   * Helper function to unserialize an entity from the JSON:API response.
   *
   * @param array $data
   *   An array of data.
   *
   * @return \Drupal\Core\Entity\EntityInterface
   *   An unserialize entity.
   */
  public function extractEntity(array $data);

  /**
   * Create or update the entity reference field values of an entity.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity to update.
   * @param array $data
   *   An array of data.
   */
  public function updateRelationships(ContentEntityInterface $entity, array $data);

  /**
   * Create or update the entity reference field values of an entity.
   *
   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
   *   The entity to update.
   * @param array $data
   *   An array of data. Can be modified to change the URI if needed.
   */
  public function handlePhysicalFiles(ContentEntityInterface $entity, array &$data);

  /**
   * Use data from the JSON:API to import content.
   *
   * @param array $entity_list_data
   *   An array of data from a JSON:API endpoint.
   *
   * @return int[]
   *   The list of entity ids imported.
   */
  public function importEntityListData(array $entity_list_data);

  /**
   * Set the remote to get content from.
   *
   * @param \Drupal\entity_share_client\Entity\RemoteInterface $remote
   *   The remote website to get content from.
   */
  public function setRemote(RemoteInterface $remote);

  /**
   * Allow to clear imported entities counter.
   *
   * So the same entity can be reimported multiple times during the same PHP
   * process.
   *
   * Without argument, all imported entities counter are deleted.
   *
   * If a langcode is passed, all imported entities counter in this langcode are
   * deleted.
   *
   * If an entity UUID is passed, the imported entity counter is deleted for all
   * languages.
   *
   * If a langcode and an entity UUID are passed, the imported entity counter is
   * deleted for the specified language.
   *
   * @param string $langcode
   *   The langcode for which to clear the imported entities.
   * @param string $entity_uuid
   *   The UUID of the entity to clear the langcode for.
   */
  public function clearImportedEntities($langcode = '', $entity_uuid = '');

}

Members

Namesort descending Modifiers Type Description Overrides
JsonapiHelperInterface::buildEntitiesOptions public function Prepare entities from an URI to request. 1
JsonapiHelperInterface::clearImportedEntities public function Allow to clear imported entities counter. 1
JsonapiHelperInterface::extractEntity public function Helper function to unserialize an entity from the JSON:API response. 1
JsonapiHelperInterface::handlePhysicalFiles public function Create or update the entity reference field values of an entity. 1
JsonapiHelperInterface::importEntityListData public function Use data from the JSON:API to import content. 1
JsonapiHelperInterface::setRemote public function Set the remote to get content from. 1
JsonapiHelperInterface::updateRelationships public function Create or update the entity reference field values of an entity. 1