public static function EntityShareUtility::prepareData in Entity Share 8.2
Same name and namespace in other branches
- 8.3 src/EntityShareUtility.php \Drupal\entity_share\EntityShareUtility::prepareData()
 
Uniformize JSON data in case of single value.
Parameters
array $data: The JSON data.
Return value
array An array of data.
19 calls to EntityShareUtility::prepareData()
- BlockFieldBlockContentImporter::importBlockContentEntities in modules/
entity_share_client/ src/ EventSubscriber/ BlockFieldBlockContentImporter.php  - Import block contents from block field.
 - ContentEntityReferenceTest::testReferencedEntityCreated in modules/
entity_share_client/ tests/ src/ Functional/ ContentEntityReferenceTest.php  - Test that a referenced entity is pulled even if not selected.
 - DiffController::compareEntities in modules/
entity_share_client/ src/ Controller/ DiffController.php  - Returns a table showing the differences between local and remote entities.
 - EntityShareAsyncWorker::processItem in modules/
entity_share_async/ src/ Plugin/ QueueWorker/ EntityShareAsyncWorker.php  - Works on a single queue item.
 - EntityShareClientCliService::pull in modules/
entity_share_client/ src/ Service/ EntityShareClientCliService.php  - Pull content.
 
File
- src/
EntityShareUtility.php, line 21  
Class
- EntityShareUtility
 - Contains helper methods for Entity share.
 
Namespace
Drupal\entity_shareCode
public static function prepareData(array $data) {
  if (self::isNumericArray($data)) {
    return $data;
  }
  else {
    return [
      $data,
    ];
  }
}