Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
SMW\Query\PrintRequest Class Reference

Public Member Functions

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

Static Public Member Functions

static newFromText ($text, $showMode=false)
 

Public Attributes

const PRINT_CATS = 0
 
const PRINT_PROP = 1
 
const PRINT_THIS = 2
 
const PRINT_CCAT = 3
 
const PRINT_CHAIN = 4
 

Protected Attributes

 $m_mode
 
 $m_label
 
 $m_data
 
 $m_typeid = false
 
 $m_outputformat
 
 $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.

Author
Markus Krötzsch

Constructor & Destructor Documentation

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

Create a print request.

Parameters
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.

Returns
string
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::getLabel ( )
SMW\Query\PrintRequest::getMode ( )
SMW\Query\PrintRequest::getOutputFormat ( )
SMW\Query\PrintRequest::getParameter (   $key)

Returns the value of a named parameter.

Parameters
$keystring the name of the parameter key
Returns
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.

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

Serialise this object like print requests given in #ask.

Parameters
$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.

Returns
string
SMW\Query\PrintRequest::getWikiText (   $linker = false)

Obtain a Wiki-formatted representation of the label.

SMW\Query\PrintRequest::isMode (   $mode)
Since
2.5
Parameters
integer$mode
Returns
boolean
static SMW\Query\PrintRequest::newFromText (   $text,
  $showMode = false 
)
static
See also
Deserializer::deserialize
Since
2.4
Parameters
string$text
$showMode= false
Returns
PrintRequest|null
SMW\Query\PrintRequest::removeParameter (   $key)

Removes a request parameter

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

Sets a print request parameter.

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

Member Data Documentation

SMW\Query\PrintRequest::$m_data
protected
SMW\Query\PrintRequest::$m_hash = false
protected
SMW\Query\PrintRequest::$m_label
protected
SMW\Query\PrintRequest::$m_mode
protected
SMW\Query\PrintRequest::$m_outputformat
protected
SMW\Query\PrintRequest::$m_params = array()
protected
SMW\Query\PrintRequest::$m_typeid = false
protected
const SMW\Query\PrintRequest::PRINT_CATS = 0

Query mode to print all direct categories of the current element.

const SMW\Query\PrintRequest::PRINT_CCAT = 3

Query mode to print whether current element is in given category (Boolean printout).

const SMW\Query\PrintRequest::PRINT_CHAIN = 4

Query mode indicating a chainable property value entity, with the last element to represent the printable output

const SMW\Query\PrintRequest::PRINT_PROP = 1

Query mode to print all property values of a certain attribute of the current element.

const SMW\Query\PrintRequest::PRINT_THIS = 2

Query mode to print the current element (page in result set).


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