getAllCollectionNamesHelper example

public function getCollectionName() {
    return $this->collection;
  }

  /** * {@inheritdoc} */
  public function getAllCollectionNames() {
    if (!is_dir($this->directory)) {
      return [];
    }
    $collections = $this->getAllCollectionNamesHelper($this->directory);
    sort($collections);
    return $collections;
  }

  /** * Helper function for getAllCollectionNames(). * * If the file storage has the following subdirectory structure: * ./another_collection/one * ./another_collection/two * ./collection/sub/one * ./collection/sub/two * this function will return: * @code * array( * 'another_collection.one', * 'another_collection.two', * 'collection.sub.one', * 'collection.sub.two', * ); * @endcode * * @param string $directory * The directory to check for sub directories. This allows this * function to be used recursively to discover all the collections in the * storage. It is the responsibility of the caller to ensure the directory * exists. * * @return array * A list of collection names contained within the provided directory. */
Home | Imprint | This part of the site doesn't use cookies.