• PHP reference
  • Sandbox

Container

class Sandbox\Container extends ExtendableObject

Main Sandbox interface class. Within modules, you can access an instance of this class using $this.

Properties

SandboxUser $user

Holds user data.

Module $module

Holds module information.

Community $site

Holds community data.

Community $community

Holds community data.

Storage $storage

Enables storage features.

Settings $settings

Holds module settings.

Request $request

Request information.

Response $response

Response settings.

Socket $socket

Socket interface for real time messages.

Language $language

Language methods.

API $api

API helpers.

ComponentController $components

Components controller.

Methods

__construct()

Container constructor.

integer hook_call(string $hookname)

Call a hook.

Parameters

  • string $hookname

Return Value

  • integer Number of hooks called

boolean has_hook(string $hookname)

Check if a hook exists for a certain hook name.

Parameters

  • string $hookname

Return Value

  • boolean

mixed import(string $namespace, string $name = null)

Import an exported object/file.

Parameters

  • string $namespace The module namespace
  • string $name The export name

Return Value

  • mixed

Inherited from ExtendableObject

final static ExtendableObject instance()

Get instance.

Return Value

final static boolean hasInstance()

Check whether there is an instance of this class available.

Return Value

  • boolean

final boolean extension($extension)

Call class method, if it exists.

Parameters

  • $extension

Return Value

  • boolean