You are here

protected function JsonWriterTrait::getDataFromFile in Content Synchronizer 8

Same name and namespace in other branches
  1. 8.2 src/Base/JsonWriterTrait.php \Drupal\content_synchronizer\Base\JsonWriterTrait::getDataFromFile()
  2. 3.x 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 27

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;
}