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)
 
 isDisconnected ( $isDisconnected)
 
 markThisLabel ( $text)
 
 hasLabelMarker ()
 
 isMode ( $mode)
 
 getMode ()
 
 getLabel ()
 
 getCanonicalLabel ()
 
 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, $useCanonicalLabel=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 = []
 

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

◆ __construct()

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

◆ getCanonicalLabel()

SMW\Query\PrintRequest::getCanonicalLabel ( )
Since
3.0
Returns
string

◆ getData()

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.

◆ getHash()

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

◆ getHTMLText()

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.

◆ getParameter()

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)

◆ getParameters()

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.

◆ getSerialisation()

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

◆ getText()

SMW\Query\PrintRequest::getText (   $outputMode,
  $linker = null 
)

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

◆ getTypeID()

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

◆ getWikiText()

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

Obtain a Wiki-formatted representation of the label.

◆ hasLabelMarker()

SMW\Query\PrintRequest::hasLabelMarker ( )
Since
3.0
Returns
boolean

◆ isDisconnected()

SMW\Query\PrintRequest::isDisconnected (   $isDisconnected)
Since
3.0
Parameters
boolean$isDisconnected

◆ isMode()

SMW\Query\PrintRequest::isMode (   $mode)
Since
2.5
Parameters
integer$mode
Returns
boolean

◆ markThisLabel()

SMW\Query\PrintRequest::markThisLabel (   $text)
Since
3.0
Parameters
string$text

◆ newFromText()

static SMW\Query\PrintRequest::newFromText (   $text,
  $showMode = false,
  $useCanonicalLabel = false 
)
static
See also
Deserializer::deserialize
Since
2.4
Parameters
string$text
boalean$showMode= false
boolean$useCanonicalLabel= false
Returns
PrintRequest|null

◆ removeParameter()

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

Removes a request parameter

Since
3.0
Parameters
string$key

◆ setLabel()

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

◆ setParameter()

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

◆ PRINT_CATS

const SMW\Query\PrintRequest::PRINT_CATS = 0

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

◆ PRINT_CCAT

const SMW\Query\PrintRequest::PRINT_CCAT = 3

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

◆ PRINT_CHAIN

const SMW\Query\PrintRequest::PRINT_CHAIN = 4

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

◆ PRINT_PROP

const SMW\Query\PrintRequest::PRINT_PROP = 1

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

◆ PRINT_THIS

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:

About | General disclaimer | Privacy policy