Nextcloud PHP API (master)

IManager

Interface IManager

Tags
since
6.0.0

Table of Contents

Methods

generateEvent()  : IEvent
Generates a new IEvent object
getCurrentUserId()  : string
Get the user we need to use
getFilterById()  : IFilter
getFilters()  : array<string|int, IFilter>
getProviders()  : array<string|int, IProvider>
getRequirePNG()  : bool
getSettingById()  : ActivitySettings
getSettings()  : array<string|int, ActivitySettings>
isFormattingFilteredObject()  : bool
publish()  : void
Publish an event to the activity consumers
registerConsumer()  : void
In order to improve lazy loading a closure can be registered which will be called in case activity consumers are actually requested
registerFilter()  : void
registerProvider()  : void
registerSetting()  : void
setCurrentUserId()  : void
Set the user we need to use
setFormattingObject()  : void
setRequirePNG()  : void

Methods

generateEvent()

Generates a new IEvent object

public generateEvent() : IEvent

Make sure to call at least the following methods before sending it to the app with via the publish() method:

  • setApp()
  • setType()
  • setAffectedUser()
  • setSubject()
  • setObject()
Tags
since
8.2.0
Return values
IEvent

getCurrentUserId()

Get the user we need to use

public getCurrentUserId() : string

Either the user is logged in, or we try to get it from the token

Tags
throws
UnexpectedValueException

If the token is invalid, does not exist or is not unique

since
8.1.0
Return values
string

getFilters()

public getFilters() : array<string|int, IFilter>
Tags
since
11.0.0
Return values
array<string|int, IFilter>

getRequirePNG()

public getRequirePNG() : bool
Tags
since
12.0.1
Return values
bool

isFormattingFilteredObject()

public isFormattingFilteredObject() : bool
Tags
since
8.2.0
Return values
bool

publish()

Publish an event to the activity consumers

public publish(IEvent $event) : void

Make sure to call at least the following methods before sending an Event:

  • setApp()
  • setType()
  • setAffectedUser()
  • setSubject()
  • setObject()
Parameters
$event : IEvent
Tags
throws
IncompleteActivityException

if required values have not been set

since
8.2.0
since
30.0.0

throws IncompleteActivityException instead of \BadMethodCallException

registerConsumer()

In order to improve lazy loading a closure can be registered which will be called in case activity consumers are actually requested

public registerConsumer(Closure $callable) : void

$callable has to return an instance of \OCP\Activity\IConsumer

Parameters
$callable : Closure
Tags
since
6.0.0

registerFilter()

public registerFilter(string $filter) : void
Parameters
$filter : string

Class must implement OCA\Activity\IFilter

Tags
since
11.0.0

registerProvider()

public registerProvider(string $provider) : void
Parameters
$provider : string

Class must implement OCA\Activity\IProvider

Tags
since
11.0.0

registerSetting()

public registerSetting(string $setting) : void
Parameters
$setting : string

Class must implement OCA\Activity\ISetting

Tags
since
11.0.0

setCurrentUserId()

Set the user we need to use

public setCurrentUserId([string|null $currentUserId = null ]) : void
Parameters
$currentUserId : string|null = null
Tags
since
9.0.1

setFormattingObject()

public setFormattingObject(string $type, int $id) : void
Parameters
$type : string
$id : int
Tags
since
8.2.0

setRequirePNG()

public setRequirePNG(bool $status) : void
Parameters
$status : bool

Set to true, when parsing events should not use SVG icons

Tags
since
12.0.1

        
On this page

Search results