Puli\Repository\Api\EditableRepository::add PHP Method

add() public method

All resources passed to this method must implement {@link PuliResource}.
public add ( string $path, Puli\Repository\Api\Resource\PuliResource | Puli\Repository\Api\ResourceCollection $resource )
$path string The path at which to add the resource.
$resource Puli\Repository\Api\Resource\PuliResource | Puli\Repository\Api\ResourceCollection The resource(s) to add at that path.
    public function add($path, $resource);

Usage Example

 private function addInOrder(array $filesystemPaths)
 {
     foreach ($filesystemPaths as $packageName => $filesystemPathsByRepoPath) {
         foreach ($filesystemPathsByRepoPath as $repoPath => $filesystemPaths) {
             foreach ($filesystemPaths as $filesystemPath) {
                 $this->repo->add($repoPath, $this->createResource($filesystemPath));
             }
         }
     }
 }
All Usage Examples Of Puli\Repository\Api\EditableRepository::add
EditableRepository