Nextcloud PHP API (master)

IAppContainer extends ContainerInterface, IContainer

This is a tagging interface for a container that belongs to an app

The interface currently extends IContainer, but this interface is deprecated as of Nextcloud 20, thus this interface won't extend it anymore once that was removed. So migrate to the ContainerInterface only.

Tags
since
6.0.0

Table of Contents

Methods

get()  : T : mixed)
Finds an entry of the container by its identifier and returns it.
getAppName()  : string
used to return the appname of the set application
getServer()  : ContainerInterface
registerCapability()  : mixed
Register a capability
registerMiddleWare()  : bool

Methods

get()

Finds an entry of the container by its identifier and returns it.

public get(T>|string $id) : T : mixed)
Parameters
$id : T>|string

Identifier of the entry to look for.

Tags
template
throws
NotFoundExceptionInterface

No entry was found for this identifier.

ContainerExceptionInterface

Error while retrieving the entry.

since
34.0.0
Attributes
#[Override]
Return values
T : mixed) —

Entry.

getAppName()

used to return the appname of the set application

public getAppName() : string
Tags
since
6.0.0
Return values
string —

the name of your application

getServer()

public getServer() : ContainerInterface
Tags
since
6.0.0
Return values
ContainerInterface

registerCapability()

Register a capability

public registerCapability(string $serviceName) : mixed

use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCapability

Parameters
$serviceName : string

e.g. 'OCA\Files\Capabilities'

Tags
since
8.2.0

registerMiddleWare()

public registerMiddleWare(string $middleWare) : bool

use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerMiddleware

Parameters
$middleWare : string
Tags
since
6.0.0
Return values
bool
On this page

Search results