Manager

class OC\Activity\Manager
Source:lib/private/Activity/Manager.php#46
Implements:OCP\Activity\IManager

Properties

protected static property OC\Activity\Manager::$request
Source:lib/private/Activity/Manager.php#48
Type:\OCP\IRequest
protected static property OC\Activity\Manager::$session
Source:lib/private/Activity/Manager.php#51
Type:\OCP\IUserSession
protected static property OC\Activity\Manager::$config
Source:lib/private/Activity/Manager.php#54
Type:\OCP\IConfig
protected static property OC\Activity\Manager::$validator
Source:lib/private/Activity/Manager.php#57
Type:\OCP\RichObjectStrings\IValidator
protected static property OC\Activity\Manager::$formattingObjectType
Source:lib/private/Activity/Manager.php#60
Type:string
protected static property OC\Activity\Manager::$formattingObjectId
Source:lib/private/Activity/Manager.php#63
Type:int
protected static property OC\Activity\Manager::$requirePNG
Source:lib/private/Activity/Manager.php#66
Type:bool
protected static property OC\Activity\Manager::$currentUserId
Source:lib/private/Activity/Manager.php#69
Type:string
protected static property OC\Activity\Manager::$l10n
Source:lib/private/Activity/Manager.php#71
protected static property OC\Activity\Manager::$filterClasses
Source:lib/private/Activity/Manager.php#176
Type:string[]
protected static property OC\Activity\Manager::$filters
Source:lib/private/Activity/Manager.php#179
Type:\OCP\Activity\IFilter[]
protected static property OC\Activity\Manager::$providerClasses
Source:lib/private/Activity/Manager.php#226
Type:string[]
protected static property OC\Activity\Manager::$providers
Source:lib/private/Activity/Manager.php#229
Type:\OCP\Activity\IProvider[]
protected static property OC\Activity\Manager::$settingsClasses
Source:lib/private/Activity/Manager.php#260
Type:string[]
protected static property OC\Activity\Manager::$settings
Source:lib/private/Activity/Manager.php#263
Type:\OCP\Activity\ISetting[]

Methods

public OC\Activity\Manager::__construct($request, $session, $config, $validator, $l10n)
Source:lib/private/Activity/Manager.php#73
protected OC\Activity\Manager::getConsumers()
Source:lib/private/Activity/Manager.php#96
Returns:\OCP\Activity\IConsumer[]
public OC\Activity\Manager::generateEvent()
Generates a new IEvent object
Make sure to call at least the following methods before sending it to the
app with via the publish() method:
- setApp()
- setType()
- setAffectedUser()
- setSubject()
Source:lib/private/Activity/Manager.php#126
Returns:\OCP\Activity\IEvent
public OC\Activity\Manager::publish($event)
Publish an event to the activity consumers
Make sure to call at least the following methods before sending an Event:
- setApp()
- setType()
- setAffectedUser()
- setSubject()
Source:

lib/private/Activity/Manager.php#142

Parameters:
Throws:

\BadMethodCallException if required values have not been set

public OC\Activity\Manager::registerConsumer($callable)
In order to improve lazy loading a closure can be registered which will be called in case
activity consumers are actually requested
$callable has to return an instance of OCA\Activity\IConsumer
Source:

lib/private/Activity/Manager.php#170

Parameters:
  • $callable (Closure)
public OC\Activity\Manager::registerFilter($filter)
Source:

lib/private/Activity/Manager.php#185

Parameters:
  • $filter (string) Class must implement OCAActivityIFilter
Returns:

void

public OC\Activity\Manager::getFilters()
Source:lib/private/Activity/Manager.php#193
Returns:\OCP\Activity\IFilter[]
Throws:\InvalidArgumentException
public OC\Activity\Manager::getFilterById($id)
Source:

lib/private/Activity/Manager.php#215

Parameters:
  • $id (string)
Returns:

\OCP\Activity\IFilter

Throws:

\InvalidArgumentException when the filter was not found

Since:

11.0.0

public OC\Activity\Manager::registerProvider($provider)
Source:

lib/private/Activity/Manager.php#235

Parameters:
  • $provider (string) Class must implement OCAActivityIProvider
Returns:

void

public OC\Activity\Manager::getProviders()
Source:lib/private/Activity/Manager.php#243
Returns:\OCP\Activity\IProvider[]
Throws:\InvalidArgumentException
public OC\Activity\Manager::registerSetting($setting)
Source:

lib/private/Activity/Manager.php#269

Parameters:
  • $setting (string) Class must implement OCAActivityISetting
Returns:

void

public OC\Activity\Manager::getSettings()
Source:lib/private/Activity/Manager.php#277
Returns:\OCP\Activity\ActivitySettings[]
Throws:\InvalidArgumentException
public OC\Activity\Manager::getSettingById($id)
Source:

lib/private/Activity/Manager.php#303

Parameters:
  • $id (string)
Returns:

\OCP\Activity\ActivitySettings

Throws:

\InvalidArgumentException when the setting was not found

Since:

11.0.0

public OC\Activity\Manager::setFormattingObject($type, $id)
Source:

lib/private/Activity/Manager.php#318

Parameters:
  • $type (string)
  • $id (int)
public OC\Activity\Manager::isFormattingFilteredObject()
Source:lib/private/Activity/Manager.php#326
Returns:bool
public OC\Activity\Manager::setRequirePNG($status)
Source:

lib/private/Activity/Manager.php#335

Parameters:
  • $status (bool) Set to true, when parsing events should not use SVG icons
public OC\Activity\Manager::getRequirePNG()
Source:lib/private/Activity/Manager.php#342
Returns:bool
public OC\Activity\Manager::setCurrentUserId($currentUserId=null)
Set the user we need to use
Source:

lib/private/Activity/Manager.php#352

Parameters:
  • $currentUserId (string | null)
Throws:

\UnexpectedValueException If the user is invalid

public OC\Activity\Manager::getCurrentUserId()
Get the user we need to use
Either the user is logged in, or we try to get it from the token
Source:lib/private/Activity/Manager.php#367
Returns:string
Throws:\UnexpectedValueException If the token is invalid, does not exist or is not unique
protected OC\Activity\Manager::getUserFromToken()
Get the user for the token
Source:lib/private/Activity/Manager.php#385
Returns:string
Throws:\UnexpectedValueException If the token is invalid, does not exist or is not unique