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

Public Member Functions

 __construct (Database $connection)
 
 isCommandLineMode ( $isCommandLineMode)
 
 waitOnTransactionIdle ()
 
 addToUsageCount ( $pid, $value)
 
 addToUsageCounts (array $additions)
 
 setUsageCount ( $propertyId, $value)
 
 insertUsageCount ( $propertyId, $value)
 
 getUsageCount ( $propertyId)
 
 getUsageCounts (array $propertyIds)
 
 deleteAll ()
 

Detailed Description

Simple implementation of PropertyStatisticsTable using MediaWikis database abstraction layer and a single table.

GNU GPL v2+

Since
1.9
Author
Jeroen De Dauw < jeroe.nosp@m.nded.nosp@m.auw@g.nosp@m.mail.nosp@m..com >
Nischay Nahata

Constructor & Destructor Documentation

◆ __construct()

SMW\SQLStore\PropertyStatisticsStore::__construct ( Database  $connection)
Since
1.9
Parameters
Database$connection

Member Function Documentation

◆ addToUsageCount()

SMW\SQLStore\PropertyStatisticsStore::addToUsageCount (   $pid,
  $value 
)

Change the usage count for the property of the given ID by the given value. The method does nothing if the count is 0.

Since
1.9
Parameters
integer$propertyId
integer$value
Returns
boolean Success indicator

◆ addToUsageCounts()

SMW\SQLStore\PropertyStatisticsStore::addToUsageCounts ( array  $additions)

Increase the usage counts of multiple properties.

The $additions parameter should be an array with integer keys that are property ids, and associated integer values that are the amount the usage count should be increased.

Since
1.9
Parameters
array$additions
Returns
boolean Success indicator

◆ deleteAll()

SMW\SQLStore\PropertyStatisticsStore::deleteAll ( )

Deletes all rows in the table.

Since
1.9
Returns
boolean Success indicator

◆ getUsageCount()

SMW\SQLStore\PropertyStatisticsStore::getUsageCount (   $propertyId)

Returns the usage count for a provided property id.

Since
2.2
Parameters
integer$propertyId
Returns
integer

◆ getUsageCounts()

SMW\SQLStore\PropertyStatisticsStore::getUsageCounts ( array  $propertyIds)

Returns the usage counts of the provided properties.

The returned array contains integer keys which are property ids, with the associated values being their usage count (also integers).

Properties for which no usage count is found will not have an entry in the result array.

Since
1.9
Parameters
array$propertyIds
Returns
array

◆ insertUsageCount()

SMW\SQLStore\PropertyStatisticsStore::insertUsageCount (   $propertyId,
  $value 
)

Adds a new usage count.

Since
1.9
Parameters
integer$propertyId
integer$value
Returns
boolean Success indicator
Exceptions
PropertyStatisticsInvalidArgumentException

◆ isCommandLineMode()

SMW\SQLStore\PropertyStatisticsStore::isCommandLineMode (   $isCommandLineMode)
See also
https://www.mediawiki.org/wiki/Manual:$wgCommandLineMode Indicates whether MW is running in command-line mode or not.
Since
2.5
Parameters
boolean$isCommandLineMode

◆ setUsageCount()

SMW\SQLStore\PropertyStatisticsStore::setUsageCount (   $propertyId,
  $value 
)

Updates an existing usage count.

Since
1.9
Parameters
integer$propertyId
integer$value
Returns
boolean Success indicator
Exceptions
PropertyStatisticsInvalidArgumentException

◆ waitOnTransactionIdle()

SMW\SQLStore\PropertyStatisticsStore::waitOnTransactionIdle ( )
Since
2.5

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

About | General disclaimer | Privacy policy