Nextcloud PHP API (master)

BeforeZipCreatedEvent extends Event
in package

This event is triggered before a archive is created when a user requested downloading a folder or multiple files.

By setting successful to false the tar creation can be aborted and the download denied.

Tags
since
25.0.0

Table of Contents

Properties

$directory  : string
$errorMessage  : string|null
$files  : array<string|int, mixed>
$folder  : Folder|null
$propagationStopped  : bool
$successful  : bool

Methods

__construct()  : mixed
Compatibility constructor
getDirectory()  : string
getErrorMessage()  : string|null
Get the error message, if any
getFiles()  : array<string|int, mixed>
getFolder()  : Folder|null
isPropagationStopped()  : bool
{@inheritDoc}
isSuccessful()  : bool
setErrorMessage()  : void
setSuccessful()  : void
Set if the event was successful
stopPropagation()  : void
Stops the propagation of the event to further event listeners

Properties

$propagationStopped

private bool $propagationStopped = false
Tags
since
22.0.0

Methods

__construct()

Compatibility constructor

public __construct(string|Folder $directory, array<int, string> $files) : mixed
Parameters
$directory : string|Folder
$files : array<int, string>
Tags
since
25.0.0
since
31.0.0

support OCP\Files\Folder as $directory parameter - passing a string is deprecated now

getErrorMessage()

Get the error message, if any

public getErrorMessage() : string|null
Tags
since
25.0.0
Return values
string|null

getFiles()

public getFiles() : array<string|int, mixed>
Tags
since
25.0.0
Return values
array<string|int, mixed>

isPropagationStopped()

{@inheritDoc}

public isPropagationStopped() : bool
Tags
since
22.0.0
see
StoppableEventInterface
Return values
bool

setErrorMessage()

public setErrorMessage(string $errorMessage) : void
Parameters
$errorMessage : string
Tags
since
25.0.0

setSuccessful()

Set if the event was successful

public setSuccessful(bool $successful) : void
Parameters
$successful : bool
Tags
since
25.0.0

stopPropagation()

Stops the propagation of the event to further event listeners

public stopPropagation() : void
Tags
since
22.0.0

        
On this page

Search results