SMWSqlStubSemanticData Class Reference
[SMWStore]

This class provides a subclass of SMWSemanticData that can store prefetched values from SMW's SQL stores, and unstub this data on demand when it is accessed. More...

Inherits SMWSemanticData.

List of all members.

Public Member Functions

 getProperties ()
 Get the array of all properties that have stored values.
 getPropertyValues (SMWDIProperty $property)
 Get the array of all stored values for some property.
 hasVisibleProperties ()
 Return true if there are any visible properties.
 hasVisibleSpecialProperties ()
 Return true if there are any special properties that can be displayed.
 addPropertyStubValue ($propertyKey, array $valueKeys)
 Add data in abbreviated form so that it is only expanded if needed.
 clear ()
 Delete all data other than the subject.

Static Public Member Functions

static newFromSemanticData (SMWSemanticData $semanticData)
 Create a new SMWSqlStubSemanticData object that holds the data of a given SMWSemanticData object.

Protected Member Functions

 unstubProperties ()
 Process all mProperties that have been added as stubs.
 unstubProperty ($propertyKey, $diProperty=null)
 Unstub a single property from the stub data array.

Protected Attributes

 $mStubPropVals = array()
 $mSubject


Detailed Description

This class provides a subclass of SMWSemanticData that can store prefetched values from SMW's SQL stores, and unstub this data on demand when it is accessed.

Since:
1.6

Definition at line 22 of file SMW_SqlStubSemanticData.php.


Member Function Documentation

static SMWSqlStubSemanticData::newFromSemanticData ( SMWSemanticData semanticData  )  [static]

Create a new SMWSqlStubSemanticData object that holds the data of a given SMWSemanticData 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.

Parameters:
$semanticData SMWSemanticData
Returns:
SMWSqlStubSemanticData

Definition at line 53 of file SMW_SqlStubSemanticData.php.

References SMWSemanticData::getSubject().

Referenced by SMWSQLStore2::doDataUpdate().

SMWSqlStubSemanticData::getProperties (  ) 

Get the array of all properties that have stored values.

Returns:
array of SMWDIProperty objects

Reimplemented from SMWSemanticData.

Definition at line 68 of file SMW_SqlStubSemanticData.php.

References unstubProperties().

SMWSqlStubSemanticData::getPropertyValues ( SMWDIProperty property  ) 

Get the array of all stored values for some property.

Parameters:
$property SMWDIProperty
Returns:
array of SMWDataItem

Reimplemented from SMWSemanticData.

Definition at line 79 of file SMW_SqlStubSemanticData.php.

References SMWCompatibilityHelpers::dataItemFromDBKeys(), SMWDIProperty::findPropertyTypeID(), SMWDataValueFactory::getDataItemId(), SMWDIProperty::getKey(), smwfGetStore(), SMWDataItem::TYPE_CONTAINER, and unstubProperty().

SMWSqlStubSemanticData::hasVisibleProperties (  ) 

Return true if there are any visible properties.

Returns:
boolean

Reimplemented from SMWSemanticData.

Definition at line 122 of file SMW_SqlStubSemanticData.php.

References unstubProperties().

SMWSqlStubSemanticData::hasVisibleSpecialProperties (  ) 

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

Returns:
boolean

Reimplemented from SMWSemanticData.

Definition at line 133 of file SMW_SqlStubSemanticData.php.

References unstubProperties().

SMWSqlStubSemanticData::addPropertyStubValue ( propertyKey,
array $  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.

Parameters:
$propertyKey string
$valueKeys array

Definition at line 146 of file SMW_SqlStubSemanticData.php.

SMWSqlStubSemanticData::clear (  ) 

Delete all data other than the subject.

Reimplemented from SMWSemanticData.

Definition at line 153 of file SMW_SqlStubSemanticData.php.

SMWSqlStubSemanticData::unstubProperties (  )  [protected]

Process all mProperties that have been added as stubs.

Associated data may remain in stub form.

Definition at line 162 of file SMW_SqlStubSemanticData.php.

References unstubProperty().

Referenced by getProperties(), hasVisibleProperties(), and hasVisibleSpecialProperties().

SMWSqlStubSemanticData::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.

Parameters:
$propertyKey string
$diProperty SMWDIProperty

Definition at line 177 of file SMW_SqlStubSemanticData.php.

Referenced by getPropertyValues(), and unstubProperties().


Member Data Documentation

SMWSqlStubSemanticData::$mStubPropVals = array() [protected]

Definition at line 32 of file SMW_SqlStubSemanticData.php.

SMWSqlStubSemanticData::$mSubject [protected]

Reimplemented from SMWSemanticData.

Definition at line 41 of file SMW_SqlStubSemanticData.php.


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

Generated on Sun Mar 18 07:15:45 2012 for Semantic MediaWiki by  doxygen 1.5.6