You are here

interface ContentFileStorageInterface in Default Content for D8 2.0.x

Finds, reads and writes default content files.

Hierarchy

Expanded class hierarchy of ContentFileStorageInterface

All classes that implement ContentFileStorageInterface

File

src/ContentFileStorageInterface.php, line 10

Namespace

Drupal\default_content
View 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

Namesort descending Modifiers Type Description Overrides
ContentFileStorageInterface::scan public function Returns a list of file objects. 1
ContentFileStorageInterface::writeEntity public function Writes a normalized entity to the given folder. 1