OC_Hook

class OC_Hook
Source:lib/private/legacy/OC_Hook.php#35

Properties

public property OC_Hook::$thrownExceptions
Source:lib/private/legacy/OC_Hook.php#36

Methods

public static OC_Hook::connect($signalClass, $signalName, $slotClass, $slotName)
connects a function to a hook
Source:

lib/private/legacy/OC_Hook.php#53

Parameters:
  • $signalClass (string) class name of emitter
  • $signalName (string) name of signal
  • $slotClass (string | object) class name of slot
  • $slotName (string) name of slot
Returns:

bool This function makes it very easy to connect to use hooks.

TODO: write example

public static OC_Hook::emit($signalClass, $signalName, $params=[])
emits a signal
Source:

lib/private/legacy/OC_Hook.php#93

Parameters:
  • $signalClass (string) class name of emitter
  • $signalName (string) name of signal
  • $params (mixed) default: array() array with additional data
Returns:

bool true if slots exists or false if not

Throws:

\OC\HintException

Throws:

\OC\ServerNotAvailableException Emits a signal. To get data from the slot use references!

TODO: write example

Throws:

\OC\HintException

Throws:

\OC\ServerNotAvailableException Emits a signal. To get data from the slot use references!

TODO: write example

public static OC_Hook::clear($signalClass="", $signalName="")
clear hooks
Source:

lib/private/legacy/OC_Hook.php#131

Parameters:
  • $signalClass (string)
  • $signalName (string)
public static OC_Hook::getHooks()
DO NOT USE!
For unit tests ONLY!
Source:lib/private/legacy/OC_Hook.php#147