Nextcloud PHP API (stable18)

IManager

Interface IManager

Tags
since
6.0.0

Table of Contents

generateEvent()  : IEvent
Generates a new IEvent object
getCurrentUserId()  : string
Get the user we need to use
getFilterById()  : IFilter
getFilters()  : \OCP\Activity\IFilter[]
getProviders()  : \OCP\Activity\IProvider[]
getRequirePNG()  : bool
getSettingById()  : ISetting
getSettings()  : \OCP\Activity\ISetting[]
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()
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

getFilterById()

public getFilterById(string $id) : IFilter
Parameters
$id : string
Tags
throws
InvalidArgumentException

when the filter was not found

since
11.0.0
Return values
IFilter

getFilters()

public getFilters() : \OCP\Activity\IFilter[]
Tags
since
11.0.0
Return values
\OCP\Activity\IFilter[]

getProviders()

public getProviders() : \OCP\Activity\IProvider[]
Tags
since
11.0.0
Return values
\OCP\Activity\IProvider[]

getRequirePNG()

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

getSettingById()

public getSettingById(string $id) : ISetting
Parameters
$id : string
Tags
throws
InvalidArgumentException

when the setting was not found

since
11.0.0
Return values
ISetting

getSettings()

public getSettings() : \OCP\Activity\ISetting[]
Tags
since
11.0.0
Return values
\OCP\Activity\ISetting[]

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()
Parameters
$event : IEvent
Tags
throws
BadMethodCallException

if required values have not been set

since
8.2.0

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
throws
UnexpectedValueException

If the user is invalid

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

Search results