MediaWiki  REL1_22
DerivativeContext Class Reference

An IContextSource implementation which will inherit context from another source but allow individual pieces of context to be changed locally eg: A ContextSource that can inherit from the main RequestContext but have a different Title instance set on it. More...

Inheritance diagram for DerivativeContext:
Collaboration diagram for DerivativeContext:

List of all members.

Public Member Functions

 __construct (IContextSource $context)
 Constructor.
 canUseWikiPage ()
 Check whether a WikiPage object can be get with getWikiPage().
 getLang ()
 getLanguage ()
 Get the Language object.
 getOutput ()
 Get the OutputPage object.
 getRequest ()
 Get the WebRequest object.
 getSkin ()
 Get the Skin object.
 getTitle ()
 Get the Title object.
 getUser ()
 Get the User object.
 getWikiPage ()
 Get the WikiPage object.
 msg ()
 Get a message using the current context.
 setLang ($l)
 Set the Language object.
 setLanguage ($l)
 Set the Language object.
 setOutput (OutputPage $o)
 Set the OutputPage object.
 setRequest (WebRequest $r)
 Set the WebRequest object.
 setSkin (Skin $s)
 Set the Skin object.
 setTitle ($t)
 Set the Title object.
 setUser (User $u)
 Set the User object.
 setWikiPage (WikiPage $p)
 Set the WikiPage object.

Private Attributes

Language $lang
OutputPage $output
WebRequest $request
Skin $skin
Title $title
User $user
WikiPage $wikipage

Detailed Description

An IContextSource implementation which will inherit context from another source but allow individual pieces of context to be changed locally eg: A ContextSource that can inherit from the main RequestContext but have a different Title instance set on it.

Definition at line 32 of file DerivativeContext.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
IContextSource$contextContext to inherit from

Definition at line 65 of file DerivativeContext.php.


Member Function Documentation

Check whether a WikiPage object can be get with getWikiPage().

Callers should expect that an exception is thrown from getWikiPage() if this method returns false.

Since:
1.19
Returns:
bool

Reimplemented from ContextSource.

Definition at line 124 of file DerivativeContext.php.

Deprecated:
since 1.19 Use getLanguage instead
Returns:
Language

Reimplemented from ContextSource.

Definition at line 239 of file DerivativeContext.php.

Get the Language object.

Returns:
Language
Since:
1.19

Reimplemented from ContextSource.

Definition at line 250 of file DerivativeContext.php.

References ContextSource\getContext().

Get the OutputPage object.

Returns:
OutputPage

Reimplemented from ContextSource.

Definition at line 175 of file DerivativeContext.php.

Get the WebRequest object.

Returns:
WebRequest

Reimplemented from ContextSource.

Definition at line 83 of file DerivativeContext.php.

Get the Skin object.

Returns:
Skin

Reimplemented from ContextSource.

Definition at line 273 of file DerivativeContext.php.

Get the Title object.

Returns:
Title

Reimplemented from ContextSource.

Definition at line 108 of file DerivativeContext.php.

Get the User object.

Returns:
User

Reimplemented from ContextSource.

Definition at line 197 of file DerivativeContext.php.

Get the WikiPage object.

May throw an exception if there's no Title object set or the Title object belongs to a special namespace that doesn't have WikiPage, so use first canUseWikiPage() to check whether this method can be called safely.

Since:
1.19
Returns:
WikiPage

Reimplemented from ContextSource.

Definition at line 153 of file DerivativeContext.php.

Get a message using the current context.

This can't just inherit from ContextSource, since then it would set only the original context, and not take into account any changes.

Parameters:
StringMessage name
Variablenumber of message arguments
Returns:
Message

Reimplemented from ContextSource.

Definition at line 292 of file DerivativeContext.php.

Set the Language object.

Deprecated:
since 1.19 Use setLanguage instead
Parameters:
Language | string$lLanguage instance or language code

Definition at line 211 of file DerivativeContext.php.

References setLanguage(), and wfDeprecated().

Set the Language object.

Parameters:
Language | string$lLanguage instance or language code
Exceptions:
MWException
Since:
1.19

Definition at line 223 of file DerivativeContext.php.

Referenced by setLang().

Set the OutputPage object.

Parameters:
OutputPage$o

Definition at line 166 of file DerivativeContext.php.

Set the WebRequest object.

Parameters:
WebRequest$r

Definition at line 74 of file DerivativeContext.php.

Set the Skin object.

Parameters:
Skin$s

Definition at line 263 of file DerivativeContext.php.

Set the Title object.

Parameters:
Title$t

Definition at line 96 of file DerivativeContext.php.

Set the User object.

Parameters:
User$u

Definition at line 188 of file DerivativeContext.php.

Set the WikiPage object.

Since:
1.19
Parameters:
WikiPage$p

Definition at line 140 of file DerivativeContext.php.


Member Data Documentation

Language DerivativeContext::$lang [private]

Definition at line 55 of file DerivativeContext.php.

OutputPage DerivativeContext::$output [private]

Definition at line 47 of file DerivativeContext.php.

WebRequest DerivativeContext::$request [private]

Definition at line 35 of file DerivativeContext.php.

Skin DerivativeContext::$skin [private]

Definition at line 59 of file DerivativeContext.php.

Title DerivativeContext::$title [private]

Definition at line 39 of file DerivativeContext.php.

User DerivativeContext::$user [private]

Definition at line 51 of file DerivativeContext.php.

WikiPage DerivativeContext::$wikipage [private]

Definition at line 43 of file DerivativeContext.php.


The documentation for this class was generated from the following file: