Semantic MediaWiki and related extensions
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SMW\SQLStore\EntityStore\StubSemanticData Class Reference
Inheritance diagram for SMW\SQLStore\EntityStore\StubSemanticData:
Inheritance graph
[legend]
Collaboration diagram for SMW\SQLStore\EntityStore\StubSemanticData:
Collaboration graph
[legend]

Public Member Functions

 __construct (DIWikiPage $subject, SQLStore $store, $noDuplicates=true)
 
 isStub ()
 
 __sleep ()
 
 __wakeup ()
 
 setSequenceMap ( $sid, $sequenceMap)
 
 setCountMap ( $sid, $countMap)
 
 getProperties ()
 
 hasProperty (DIProperty $property)
 
 getPropertyValues (DIProperty $property)
 
 getSubSemanticData ()
 
 hasSubSemanticData ( $subobjectName=null)
 
 findSubSemanticData ( $subobjectName)
 
 removePropertyObjectValue (DIProperty $property, DataItem $dataItem)
 
 hasVisibleProperties ()
 
 hasVisibleSpecialProperties ()
 
 addPropertyStubValue ( $propertyKey, $valueKeys)
 
 clear ()
 
- Public Member Functions inherited from SMW\SemanticData
 __construct (DIWikiPage $subject, $noDuplicates=true)
 
 __sleep ()
 
 isStub ()
 
 getSubject ()
 
 getSequenceMap ()
 
 getCountMap ()
 
 getProperties ()
 
 hasProperty (DIProperty $property)
 
 getPropertyValues (DIProperty $property)
 
 setExtensionData ( $key, $value)
 
 getExtensionData ( $key)
 
 getOption ( $key, $default=null)
 
 setOption ( $key, $value)
 
 getErrors ()
 
 addError ( $error)
 
 getHash ()
 
 getSubSemanticData ()
 
 clearSubSemanticData ()
 
 hasVisibleProperties ()
 
 hasVisibleSpecialProperties ()
 
 addPropertyObjectValue (DIProperty $property, SMWDataItem $dataItem)
 
 addPropertyValue ( $propertyName, SMWDataItem $dataItem)
 
 addDataValue (SMWDataValue $dataValue)
 
 addSubobject (Subobject $subobject)
 
 removePropertyObjectValue (DIProperty $property, SMWDataItem $dataItem)
 
 removeProperty (DIProperty $property)
 
 clear ()
 
 isEmpty ()
 
 importDataFrom (SemanticData $semanticData)
 
 removeDataFrom (SemanticData $semanticData)
 
 hasSubSemanticData ( $subobjectName=null)
 
 findSubSemanticData ( $subobjectName)
 
 addSubSemanticData (SemanticData $semanticData)
 
 removeSubSemanticData (SemanticData $semanticData)
 

Static Public Member Functions

static newFromSemanticData (SemanticData $semanticData, SQLStore $store)
 

Protected Member Functions

 unstubProperties ()
 
 unstubProperty ( $propertyKey, $diProperty=null)
 
 isRedirect ()
 

Protected Attributes

 $store
 
 $mStubPropVals = []
 
 $mSubject
 
- Protected Attributes inherited from SMW\SemanticData
 $mPropVals = []
 
 $mProperties = []
 
 $mHasVisibleProps = false
 
 $mHasVisibleSpecs = false
 
 $mNoDuplicates
 
 $mSubject
 
 $subSemanticData
 
 $errors = []
 
 $options
 
 $extensionData = []
 
 $sequenceMap = []
 
 $countMap = []
 

Additional Inherited Members

- Public Attributes inherited from SMW\SemanticData
const OPT_LAST_MODIFIED = 'opt.last.modified'
 
const OPT_CHECK_REMNANT_ENTITIES = 'opt.check.remnant.entities'
 
const PROC_USER = 'proc.user'
 
const PROC_DELETE = 'proc.delete'
 
 $stubObject
 
 $subContainerDepthCounter = 0
 
- Static Protected Attributes inherited from SMW\SemanticData
static $mPropertyPrefix = ''
 

Detailed Description

This class provides a subclass of SemanticData that can store prefetched values from the SQL store, and unstub this data on demand when it is accessed.

GNU GPL v2+

Since
1.8
Author
Markus Krötzs
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\SQLStore\EntityStore\StubSemanticData::__construct ( DIWikiPage  $subject,
SQLStore  $store,
  $noDuplicates = true 
)
Since
1.8
Parameters
DIWikiPage$subjectto which this data refers
SQLStore$store(the parent store)
boolean$noDuplicatesstating if duplicate data should be avoided

Member Function Documentation

◆ __sleep()

SMW\SQLStore\EntityStore\StubSemanticData::__sleep ( )

Required to support php-serialization

Since
2.3
Returns
array

◆ __wakeup()

SMW\SQLStore\EntityStore\StubSemanticData::__wakeup ( )
Since
2.3

◆ addPropertyStubValue()

SMW\SQLStore\EntityStore\StubSemanticData::addPropertyStubValue (   $propertyKey,
  $valueKeys 
)

Add data in abbreviated form so that it is only expanded if needed. The property key is the DB key (string) of a property value, whereas valuekeys is an array of DBkeys for the added value that will be used to initialize the value if needed at some point. If there is only one valuekey, a single string can be used.

Since
1.8
Parameters
string$propertyKey
array | string$valueKeys

◆ clear()

SMW\SQLStore\EntityStore\StubSemanticData::clear ( )

Delete all data other than the subject.

Since
1.8

◆ findSubSemanticData()

SMW\SQLStore\EntityStore\StubSemanticData::findSubSemanticData (   $subobjectName)

◆ getProperties()

SMW\SQLStore\EntityStore\StubSemanticData::getProperties ( )

Get the array of all properties that have stored values.

Since
1.8
Returns
array of SMWDIProperty objects

◆ getPropertyValues()

SMW\SQLStore\EntityStore\StubSemanticData::getPropertyValues ( DIProperty  $property)

Get the array of all stored values for some property.

Since
1.8
Parameters
DIProperty$property
Returns
array of DataItem

◆ getSubSemanticData()

SMW\SQLStore\EntityStore\StubSemanticData::getSubSemanticData ( )
See also
SemanticData::getSubSemanticData
Note
SubSemanticData are added only on request to avoid unnecessary DB transactions
Since
2.0

◆ hasProperty()

SMW\SQLStore\EntityStore\StubSemanticData::hasProperty ( DIProperty  $property)
See also
SemanticData::hasProperty
Since
2.5
Parameters
DIProperty$property
Returns
boolean

◆ hasSubSemanticData()

SMW\SQLStore\EntityStore\StubSemanticData::hasSubSemanticData (   $subobjectName = null)
See also
SemanticData::hasSubSemanticData
Note
This method will initialize SubSemanticData first if it wasn't done yet to ensure data consistency
Since
2.0

◆ hasVisibleProperties()

SMW\SQLStore\EntityStore\StubSemanticData::hasVisibleProperties ( )

Return true if there are any visible properties.

Since
1.8
Returns
boolean

◆ hasVisibleSpecialProperties()

SMW\SQLStore\EntityStore\StubSemanticData::hasVisibleSpecialProperties ( )

Return true if there are any special properties that can be displayed.

Since
1.8
Returns
boolean

◆ isStub()

SMW\SQLStore\EntityStore\StubSemanticData::isStub ( )
Since
3.2
Returns
boolean

◆ newFromSemanticData()

static SMW\SQLStore\EntityStore\StubSemanticData::newFromSemanticData ( SemanticData  $semanticData,
SQLStore  $store 
)
static

Create a new StubSemanticData object that holds the data of a given SemanticData object. Array assignments create copies in PHP so the arrays are distinct in input and output object. The object references are copied as references in a shallow way. This is sufficient as the data items used there are immutable.

Since
1.8
Parameters
$semanticDataSemanticData
SQLStore$store
Returns
StubSemanticData

◆ removePropertyObjectValue()

SMW\SQLStore\EntityStore\StubSemanticData::removePropertyObjectValue ( DIProperty  $property,
DataItem  $dataItem 
)

Remove a value for a property identified by its DataItem object. This method removes a property-value specified by the property and dataitem. If there are no more property-values for this property it also removes the property from the mProperties.

Note
There is no check whether the type of the given data item agrees with the type of the property. Since property types can change, all parts of SMW are prepared to handle mismatched data item types anyway.
Parameters
$propertySMWDIProperty
$dataItemDataItem
Since
1.8

◆ setCountMap()

SMW\SQLStore\EntityStore\StubSemanticData::setCountMap (   $sid,
  $countMap 
)
Since
3.2
Parameters
integer$sid
[]$countMap

◆ setSequenceMap()

SMW\SQLStore\EntityStore\StubSemanticData::setSequenceMap (   $sid,
  $sequenceMap 
)
Since
3.1
Parameters
integer$sid
[]$sequenceMap

◆ unstubProperties()

SMW\SQLStore\EntityStore\StubSemanticData::unstubProperties ( )
protected

Process all mProperties that have been added as stubs. Associated data may remain in stub form.

Since
1.8

◆ unstubProperty()

SMW\SQLStore\EntityStore\StubSemanticData::unstubProperty (   $propertyKey,
  $diProperty = null 
)
protected

Unstub a single property from the stub data array. If available, an existing object for that property might be provided, so we do not need to make a new one. It is not checked if the object matches the property name.

Since
1.8
Parameters
string$propertyKey
SMWDIProperty$diPropertyif available
Exceptions
DataItemExceptionif property key is not valid and $diProperty is null

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

About | General disclaimer | Privacy policy