BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
SMW\Query\PrintRequest Class Reference

Public Member Functions

 __construct ($mode, $label, $data=null, $outputformat=false, array $params=null)
 getMode ()
 getLabel ()
 getHTMLText ($linker=null)
 getWikiText ($linked=false)
 getText ($outputmode, $linker=null)
 getData ()
 getOutputFormat ()
 getTypeID ()
 getHash ()
 getSerialisation ($showparams=false)
 getParameter ($key)
 getParameters ()
 setParameter ($key, $value)
 setLabel ($label)

Static Public Member Functions

static newFromText ($text, $showMode=false)

Public Attributes

const PRINT_CATS = 0
 Query mode to print all direct categories of the current element.
const PRINT_PROP = 1
 Query mode to print all property values of a certain attribute of the current element.
const PRINT_THIS = 2
 Query mode to print the current element (page in result set).
const PRINT_CCAT = 3
 Query mode to print whether current element is in given category (Boolean printout).

Protected Attributes

 $m_typeid = false
 $m_hash = false
 $m_params = array()

Detailed Description

Container class for request for printout, as used in queries to obtain additional information for the retrieved results.

Markus Krötzsch

Constructor & Destructor Documentation

SMW\Query\PrintRequest::__construct (   $mode,
  $data = null,
  $outputformat = false,
array  $params = null 

Create a print request.

integer$modea constant defining what to printout
string$labelthe string label to describe this printout
mixed$dataoptional data for specifying some request, might be a property object, title, or something else; interpretation depends on $mode
mixed$outputformatoptional string for specifying an output format, e.g. an output unit
array | null$paramsoptional array of further, named parameters for the print request

Member Function Documentation

SMW\Query\PrintRequest::getData ( )

Return additional data related to the print request. The result might be an object of class PropertyValue or Title, or simply NULL if no data is required for the given type of printout.

SMW\Query\PrintRequest::getHash ( )

Return a hash string that is used to eliminate duplicate print requests. The hash also includes the chosen label, so it is possible to print the same date with different labels.

SMW\Query\PrintRequest::getHTMLText (   $linker = null)

Obtain an HTML-formatted representation of the label. The $linker is a Linker object used for generating hyperlinks. If it is NULL, no links will be created.

SMW\Query\PrintRequest::getParameter (   $key)

Returns the value of a named parameter.

$keystring the name of the parameter key
string Value of the paramer, if set (else FALSE)
SMW\Query\PrintRequest::getParameters ( )

Returns the array of parameters, where a string is mapped to a string.

array Map of parameter names to values.
SMW\Query\PrintRequest::getSerialisation (   $showparams = false)

Serialise this object like print requests given in #ask.

$paramsboolean that sets if the serialization should include the extra print request parameters
SMW\Query\PrintRequest::getText (   $outputmode,
  $linker = null 

Convenience method for accessing the text in either HTML or Wiki format.

SMW\Query\PrintRequest::getTypeID ( )

If this print request refers to some property, return the type id of this property. Otherwise return '_wpg' since all other types of print request return wiki pages.

SMW\Query\PrintRequest::getWikiText (   $linked = false)

Obtain a Wiki-formatted representation of the label.

static SMW\Query\PrintRequest::newFromText (   $text,
  $showMode = false 

Create an PrintRequest object from a string description as one would normally use in #ask and related inputs. The string must start with a "?" and may contain label and formatting parameters after "=" or "#", respectively. However, further parameters, given in #ask by "|+param=value" are not allowed here; they must be added individually.

$showMode= false
SMW\Query\PrintRequest::setLabel (   $label)
$this->m_data = clone $data; // we assume that the caller denotes the object ot us; else he needs provide us with a clone
SMW\Query\PrintRequest::setParameter (   $key,

Sets a print request parameter.

$keystring Name of the parameter
$valuestring Value for the parameter

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