You are here

protected function JsonWriterTrait::getDataFromFile in Content Synchronizer 3.x

Same name and namespace in other branches
  1. 8.2 src/Base/JsonWriterTrait.php \Drupal\content_synchronizer\Base\JsonWriterTrait::getDataFromFile()
  2. 8 src/Base/JsonWriterTrait.php \Drupal\content_synchronizer\Base\JsonWriterTrait::getDataFromFile()

Get json decode data from a file.

4 calls to JsonWriterTrait::getDataFromFile()
ExportEntityWriter::addRootEntity in src/Processors/ExportEntityWriter.php
Add the entity to the exported root entities list.
ExportEntityWriter::getExportedData in src/Processors/ExportEntityWriter.php
Get the entity Type data already exported.
ImportEntity::getDataFromEntityTypeFile in src/Entity/ImportEntity.php
Return the data from the entity type data file.
ImportEntity::getRootsEntities in src/Entity/ImportEntity.php
Return the entities to import list.

File

src/Base/JsonWriterTrait.php, line 43

Class

JsonWriterTrait
Json writer tool.

Namespace

Drupal\content_synchronizer\Base

Code

protected function getDataFromFile($path) {
  if (file_exists($path)) {
    return json_decode(file_get_contents($path), TRUE);
  }
  return NULL;
}