interface ContentFileStorageInterface in Default Content for D8 2.0.x
Finds, reads and writes default content files.
Hierarchy
- interface \Drupal\default_content\ContentFileStorageInterface
Expanded class hierarchy of ContentFileStorageInterface
All classes that implement ContentFileStorageInterface
File
- src/
ContentFileStorageInterface.php, line 10
Namespace
Drupal\default_contentView source
interface ContentFileStorageInterface {
/**
* Returns a list of file objects.
*
* @param string $directory
* Absolute path to the directory to search.
*
* @return object[]
* List of stdClass objects with name and uri properties.
*/
public function scan($directory);
/**
* Writes a normalized entity to the given folder.
*
* @param string $folder
* The target folder.
* @param string $encoded
* The encoded entity (YAML).
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The content being written.
* @param string $filename
* (optional) The name of the file, defaults to UUID.yml. Must end with
* .yml.
*/
public function writeEntity(string $folder, string $encoded, ContentEntityInterface $entity, string $filename = NULL);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentFileStorageInterface:: |
public | function | Returns a list of file objects. | 1 |
ContentFileStorageInterface:: |
public | function | Writes a normalized entity to the given folder. | 1 |