You are here

protected function ContentFileStorage::putFile in Default Content for D8 2.0.x

Helper for ::writeDefaultContent to wrap file_put_contents.

Parameters

string $path: Content directory + entity directory to which to write the file.

string $uuid: Entity UUID, to be used as filename.

string $serialized_entity: The serialized entity to write.

File

src/ContentFileStorage.php, line 91

Class

ContentFileStorage
Finds, reads and writes default content files.

Namespace

Drupal\default_content

Code

protected function putFile($path, $uuid, $serialized_entity) {
  file_put_contents($path . '/' . $uuid . '.yml', $serialized_entity);
}