vB_Library_Language
extends vB_Library
in package
vB_Library_Language
Table of Contents
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- buildLanguageCache() : array<string|int, mixed>
- clearCache() : mixed
- getContentInstance() : mixed
- getLanguageCache() : array<string|int, mixed>
- getLanguages() : array<string|int, mixed>
- Fetches either the entire languages array, or a single language
- instance() : static
- Returns singleton instance of self.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
- rebuildAllLanguages() : void
- Rebuild the language data structures
- rebuildLanguage() : void
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
buildLanguageCache()
public
buildLanguageCache() : array<string|int, mixed>
Return values
array<string|int, mixed>clearCache()
public
static clearCache() : mixed
getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
getLanguageCache()
public
getLanguageCache() : array<string|int, mixed>
Return values
array<string|int, mixed>getLanguages()
Fetches either the entire languages array, or a single language
public
getLanguages([int $languageid = 0 ][, bool $baseonly = false ]) : array<string|int, mixed>
This should only be used if the actual db values are needed. Otherwise fetch from the datastore using the getLanguageCache function
Parameters
- $languageid : int = 0
-
-- if not provided (or set to 0) then all languages will be returned.
- $baseonly : bool = false
-
-- if true only fetch a subset of fields.
Return values
array<string|int, mixed> —-- either the array for the individual language or [id => language array for all]
instance()
Returns singleton instance of self.
public
static instance(mixed $class) : static
Parameters
- $class : mixed
Return values
static —- Reference to singleton instance of the requested library class
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ][, mixed $currentuserid = 0 ]) : mixed
use the functions from the notification library directly.
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed = 0
rebuildAllLanguages()
Rebuild the language data structures
public
rebuildAllLanguages() : void
rebuildLanguage()
public
rebuildLanguage(int $languageid) : void
Parameters
- $languageid : int