MetadataLiveEvent
extends AMetadataEvent
in package
MetadataLiveEvent is an event initiated when a file is created or updated.
The app contains the Node related to the created/updated file, and a FilesMetadata that already contains the currently known metadata.
Setting new metadata, or modifying already existing metadata with different value, will trigger the save of the metadata in the database.
Tags
Table of Contents
Properties
- $metadata : IFilesMetadata
- $node : Node
- $propagationStopped : bool
- $runAsBackgroundJob : bool
Methods
- __construct() : mixed
- Compatibility constructor
- getMetadata() : IFilesMetadata
- returns metadata. if known, it already contains data from the database.
- getNode() : Node
- returns related node
- isPropagationStopped() : bool
- {@inheritDoc}
- isRunAsBackgroundJobRequested() : bool
- return true if any app that catch this event requested a re-run as background job
- requestBackgroundJob() : void
- For heavy process, call this method if your app prefers to update metadata on a background/cron job, instead of the live process.
- stopPropagation() : void
- Stops the propagation of the event to further event listeners
Properties
$metadata
protected
IFilesMetadata
$metadata
$node
protected
Node
$node
$propagationStopped
private
bool
$propagationStopped
= false
Tags
$runAsBackgroundJob
private
bool
$runAsBackgroundJob
= false
Methods
__construct()
Compatibility constructor
public
__construct(Node $node, IFilesMetadata $metadata) : mixed
Parameters
- $node : Node
- $metadata : IFilesMetadata
Tags
getMetadata()
returns metadata. if known, it already contains data from the database.
public
getMetadata() : IFilesMetadata
If the object is modified using its setters, changes are stored in database at the end of the event.
Tags
Return values
IFilesMetadatagetNode()
returns related node
public
getNode() : Node
Tags
Return values
NodeisPropagationStopped()
{@inheritDoc}
public
isPropagationStopped() : bool
Tags
Return values
boolisRunAsBackgroundJobRequested()
return true if any app that catch this event requested a re-run as background job
public
isRunAsBackgroundJobRequested() : bool
Tags
Return values
boolrequestBackgroundJob()
For heavy process, call this method if your app prefers to update metadata on a background/cron job, instead of the live process.
public
requestBackgroundJob() : void
A similar MetadataBackgroundEvent will be broadcast on next cron tick.
Tags
stopPropagation()
Stops the propagation of the event to further event listeners
public
stopPropagation() : void