Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | List of all members
SMW\QueryPrinterFactory Class Reference

Public Member Functions

 registerFormat ( $formatName, $class)
 
 registerAliases ( $formatName, array $aliases)
 
 getFormats ()
 
 hasFormat ( $formatName)
 
 getPrinter ( $formatName)
 
 getCanonicalName ( $formatName)
 

Static Public Member Functions

static singleton ()
 

Detailed Description

Factory for "result formats", ie classes implementing QueryResultPrinter.

GNU GPL v2+

Since
2.5 (since 1.9, renamed in 2.5)
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >

Member Function Documentation

◆ getCanonicalName()

SMW\QueryPrinterFactory::getCanonicalName (   $formatName)

Resolves format aliases into their associated canonical format name.

Since
2.5
Parameters
string$formatNameFormat name or alias
Returns
string
Exceptions
InvalidArgumentException

◆ getFormats()

SMW\QueryPrinterFactory::getFormats ( )

Returns the canonical format names.

Since
2.5
Returns
string[]

◆ getPrinter()

SMW\QueryPrinterFactory::getPrinter (   $formatName)

Returns a new instance of the handling result printer for the provided format.

Since
2.5
Parameters
string$formatName
Returns
QueryResultPrinter
Exceptions
ResultFormatNotFoundException

◆ hasFormat()

SMW\QueryPrinterFactory::hasFormat (   $formatName)

Returns if there is a format or format alias with the provided name.

Since
2.5
Parameters
string$formatNameFormat name or alias
Returns
boolean

◆ registerAliases()

SMW\QueryPrinterFactory::registerAliases (   $formatName,
array  $aliases 
)

Registers the provided format aliases. If an aliases is already registered, it will be overridden with the newly provided data.

Since
2.5
Parameters
string$formatName
array$aliases
Exceptions
InvalidArgumentException

◆ registerFormat()

SMW\QueryPrinterFactory::registerFormat (   $formatName,
  $class 
)

Registers a format. If there is a format already with the provided name, it will be overridden with the newly provided data.

Since
2.5
Parameters
string$formatName
string$class
Exceptions
InvalidArgumentException

◆ singleton()

static SMW\QueryPrinterFactory::singleton ( )
static

Returns the global instance of the factory.

Since
2.5
Returns
QueryPrinterFactory

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

About | General disclaimer | Privacy policy