Semantic MediaWiki and related extensions
Public Member Functions | List of all members
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore Class Reference
Collaboration diagram for SMW\SQLStore\QueryDependency\QueryDependencyLinksStore:
Collaboration graph
[legend]

Public Member Functions

 __construct (QueryResultDependencyListResolver $queryResultDependencyListResolver, DependencyLinksTableUpdater $dependencyLinksTableUpdater)
 
 setLogger (LoggerInterface $logger)
 
 setStore (Store $store)
 
 isCommandLineMode ($isCommandLineMode)
 
 isEnabled ()
 
 setEnabled ($isEnabled)
 
 pruneOutdatedTargetLinks (DIWikiPage $subject, CompositePropertyTableDiffIterator $compositePropertyTableDiffIterator)
 
 buildParserCachePurgeJobParametersFrom (EntityIdListRelevanceDetectionFilter $entityIdListRelevanceDetectionFilter)
 
 findEmbeddedQueryIdListBySubject (DIWikiPage $subject, RequestOptions $requestOptions=null)
 
 findEmbeddedQueryTargetLinksHashListBySubject (DIWikiPage $subject, RequestOptions $requestOptions)
 
 findEmbeddedQueryTargetLinksHashListFrom (array $idlist, RequestOptions $requestOptions)
 
 doUpdateDependenciesFrom ($queryResult)
 

Detailed Description

GNU GPL v2+

Since
2.3
Author
mwjames

Constructor & Destructor Documentation

SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::__construct ( QueryResultDependencyListResolver  $queryResultDependencyListResolver,
DependencyLinksTableUpdater  $dependencyLinksTableUpdater 
)
Since
2.3
Parameters
QueryResultDependencyListResolver$queryResultDependencyListResolver
DependencyLinksTableUpdater$dependencyLinksTableUpdater

Member Function Documentation

SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::buildParserCachePurgeJobParametersFrom ( EntityIdListRelevanceDetectionFilter  $entityIdListRelevanceDetectionFilter)

Build the ParserCachePurgeJob parameters on filtered entities to minimize necessary update work.

Since
2.3
Parameters
EntityIdListRelevanceDetectionFilter$entityIdListRelevanceDetectionFilter
Returns
array
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::doUpdateDependenciesFrom (   $queryResult)

This method is called from the SMW::Store::AfterQueryResultLookupComplete hook to resolve and update dependencies fetched from an embedded query and its QueryResult object.

Since
2.3
Parameters
QueryResult | string$queryResult
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::findEmbeddedQueryIdListBySubject ( DIWikiPage  $subject,
RequestOptions  $requestOptions = null 
)
Since
2.5
Parameters
DIWikiPage$subject
RequestOptions | null$requestOptions
Returns
array
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::findEmbeddedQueryTargetLinksHashListBySubject ( DIWikiPage  $subject,
RequestOptions  $requestOptions 
)
Since
2.5
Parameters
DIWikiPage$subject
RequestOptions$requestOptions
Returns
array
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::findEmbeddedQueryTargetLinksHashListFrom ( array  $idlist,
RequestOptions  $requestOptions 
)

Finds a partial list (given limit and offset) of registered subjects that that represent a dependency on something like a subject in a query list, a property, or a printrequest.

s_id contains the subject id that links to the query that fulfills one of the conditions cited above.

Prefetched Ids are turned into a hash list that can later be split into chunks to work either in online or batch mode without creating a huge memory foothold.

Note
Select a list is crucial for performance as any selectRow would / single Id select would strain the system on large list connected to a query
Since
2.3
Parameters
array$idlist
RequestOptions$requestOptions
Returns
array
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::isCommandLineMode (   $isCommandLineMode)
See also
https://www.mediawiki.org/wiki/Manual:$wgCommandLineMode Indicates whether MW is running in command-line mode.
Since
2.5
Parameters
boolean$isCommandLineMode
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::isEnabled ( )
Since
2.3
Returns
boolean
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::pruneOutdatedTargetLinks ( DIWikiPage  $subject,
CompositePropertyTableDiffIterator  $compositePropertyTableDiffIterator 
)

This method is called from the SMW::SQLStore::AfterDataUpdateComplete hook and removes outdated query ID's from the table if the diff contains a delete entry for the _ask table.

Since
2.3
Parameters
CompositePropertyTableDiffIterator$compositePropertyTableDiffIterator
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::setEnabled (   $isEnabled)
Since
2.3
Parameters
boolean$isEnabled
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::setLogger ( LoggerInterface  $logger)
See also
LoggerAwareInterface::setLogger
Since
2.5
Parameters
LoggerInterface$logger
SMW\SQLStore\QueryDependency\QueryDependencyLinksStore::setStore ( Store  $store)
Since
2.5
Parameters
Store$store

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