addFilesystemResource() protected method

Adds a filesystem resource to the JSON file.
protected addFilesystemResource ( string $path, Puli\Repository\Api\Resource\FilesystemResource $resource )
$path string The Puli path.
$resource Puli\Repository\Api\Resource\FilesystemResource The resource to add.
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function addFilesystemResource($path, FilesystemResource $resource)
 {
     // Read children before attaching the resource to this repository
     $children = $resource->listChildren();
     parent::addFilesystemResource($path, $resource);
     // Recursively add all child resources
     $basePath = '/' === $path ? $path : $path . '/';
     foreach ($children as $name => $child) {
         $this->addFilesystemResource($basePath . $name, $child);
     }
 }