Inherited by SMWContainerSemanticData, and SMWSqlStubSemanticData.
Public Member Functions | |
| __construct (SMWDIWikiPage $subject, $noDuplicates=true) | |
| Constructor. | |
| __sleep () | |
| This object is added to the parser output of MediaWiki, but it is not useful to have all its data as part of the parser cache since the data is already stored in more accessible format in SMW. | |
| getSubject () | |
| Return subject to which the stored semantic annotations refer to. | |
| getProperties () | |
| Get the array of all properties that have stored values. | |
| getPropertyValues (SMWDIProperty $property) | |
| Get the array of all stored values for some property. | |
| getHash () | |
| Generate a hash value to simplify the comparison of this data container with other containers. | |
| hasVisibleProperties () | |
| Return true if there are any visible properties. | |
| hasVisibleSpecialProperties () | |
| Return true if there are any special properties that can be displayed. | |
| addPropertyObjectValue (SMWDIProperty $property, SMWDataItem $dataItem) | |
| Store a value for a property identified by its SMWDataItem object. | |
| addPropertyValue ($propertyName, SMWDataItem $dataItem) | |
| Store a value for a given property identified by its text label (without namespace prefix). | |
| clear () | |
| Delete all data other than the subject. | |
| importDataFrom (SMWSemanticData $semanticData) | |
| Add all data from the given SMWSemanticData. | |
Public Attributes | |
| $stubObject | |
Protected Attributes | |
| $mPropVals = array() | |
| $mProperties = array() | |
| $mHasVisibleProps = false | |
| $mHasVisibleSpecs = false | |
| $mNoDuplicates | |
| $mSubject | |
Static Protected Attributes | |
| static | $mPropertyPrefix = '' |
This is a light-weight data container.
By its very design, the container is unable to hold inverse properties. For one thing, it would not be possible to identify them with mere keys. Since SMW cannot annotate pages with inverses, this is not a limitation.
Definition at line 24 of file SMW_SemanticData.php.
| SMWSemanticData::__construct | ( | SMWDIWikiPage $ | subject, | |
| $ | noDuplicates = true | |||
| ) |
Constructor.
| SMWDIWikiPage | $subject to which this data refers | |
| boolean | $noDuplicates stating if duplicate data should be avoided |
Definition at line 103 of file SMW_SemanticData.php.
References clear().
| SMWSemanticData::__sleep | ( | ) |
This object is added to the parser output of MediaWiki, but it is not useful to have all its data as part of the parser cache since the data is already stored in more accessible format in SMW.
Hence this implementation of __sleep() makes sure only the subject is serialised, yielding a minimal stub data container after unserialisation. This is a little safer than serialising nothing: if, for any reason, SMW should ever access an unserialised parser output, then the Semdata container will at least look as if properly initialised (though empty).
Reimplemented in SMWContainerSemanticData.
Definition at line 122 of file SMW_SemanticData.php.
| SMWSemanticData::getSubject | ( | ) |
Return subject to which the stored semantic annotations refer to.
Reimplemented in SMWContainerSemanticData.
Definition at line 131 of file SMW_SemanticData.php.
Referenced by SMWContainerSemanticData::copyDataFrom(), SMWSQLStoreLight::doDataUpdate(), SMWSQLStore2::doDataUpdate(), SMWExporter::makeExportData(), and SMWSqlStubSemanticData::newFromSemanticData().
| SMWSemanticData::getProperties | ( | ) |
Get the array of all properties that have stored values.
Reimplemented in SMWSqlStubSemanticData.
Definition at line 140 of file SMW_SemanticData.php.
Referenced by SMWContainerSemanticData::copyDataFrom(), SMWSpecialBrowse::displayData(), getHash(), and importDataFrom().
| SMWSemanticData::getPropertyValues | ( | SMWDIProperty $ | property | ) |
Get the array of all stored values for some property.
| $property | SMWDIProperty |
Reimplemented in SMWSqlStubSemanticData.
Definition at line 151 of file SMW_SemanticData.php.
References SMWDIProperty::getKey().
Referenced by SMWContainerSemanticData::copyDataFrom(), SMWSpecialBrowse::displayData(), SMWSQLStore2::doDataUpdate(), SMWFactbox::getFactboxText(), getHash(), importDataFrom(), and SMWExporter::makeExportData().
| SMWSemanticData::getHash | ( | ) |
Generate a hash value to simplify the comparison of this data container with other containers.
The hash uses PHP's md5 implementation, which is among the fastest hash algorithms that PHP offers.
Definition at line 171 of file SMW_SemanticData.php.
References getProperties(), and getPropertyValues().
| SMWSemanticData::hasVisibleProperties | ( | ) |
Return true if there are any visible properties.
Reimplemented in SMWSqlStubSemanticData.
Definition at line 197 of file SMW_SemanticData.php.
Referenced by SMWContainerSemanticData::copyDataFrom(), and importDataFrom().
| SMWSemanticData::hasVisibleSpecialProperties | ( | ) |
Return true if there are any special properties that can be displayed.
Reimplemented in SMWSqlStubSemanticData.
Definition at line 211 of file SMW_SemanticData.php.
Referenced by SMWContainerSemanticData::copyDataFrom(), and importDataFrom().
| SMWSemanticData::addPropertyObjectValue | ( | SMWDIProperty $ | property, | |
| SMWDataItem $ | dataItem | |||
| ) |
Store a value for a property identified by its SMWDataItem object.
| $property | SMWDIProperty | |
| $dataItem | SMWDataItem |
Definition at line 226 of file SMW_SemanticData.php.
References SMWDataItem::getHash(), and SMWDIProperty::getKey().
Referenced by addPropertyValue(), and importDataFrom().
| SMWSemanticData::addPropertyValue | ( | $ | propertyName, | |
| SMWDataItem $ | dataItem | |||
| ) |
Store a value for a given property identified by its text label (without namespace prefix).
| $propertyName | string | |
| $dataItem | SMWDataItem |
Definition at line 259 of file SMW_SemanticData.php.
References addPropertyObjectValue(), SMWPropertyValue::makeUserProperty(), and smwfNormalTitleDBKey().
| SMWSemanticData::clear | ( | ) |
Delete all data other than the subject.
Reimplemented in SMWSqlStubSemanticData.
Definition at line 285 of file SMW_SemanticData.php.
Referenced by __construct().
| SMWSemanticData::importDataFrom | ( | SMWSemanticData $ | semanticData | ) |
Add all data from the given SMWSemanticData.
| $semanticData | SMWSemanticData object to copy from |
Definition at line 300 of file SMW_SemanticData.php.
References addPropertyObjectValue(), getProperties(), getPropertyValues(), hasVisibleProperties(), and hasVisibleSpecialProperties().
SMWSemanticData::$mPropertyPrefix = '' [static, protected] |
Definition at line 31 of file SMW_SemanticData.php.
| SMWSemanticData::$stubObject |
Definition at line 41 of file SMW_SemanticData.php.
SMWSemanticData::$mPropVals = array() [protected] |
Definition at line 49 of file SMW_SemanticData.php.
SMWSemanticData::$mProperties = array() [protected] |
Definition at line 56 of file SMW_SemanticData.php.
SMWSemanticData::$mHasVisibleProps = false [protected] |
Definition at line 63 of file SMW_SemanticData.php.
SMWSemanticData::$mHasVisibleSpecs = false [protected] |
Definition at line 73 of file SMW_SemanticData.php.
SMWSemanticData::$mNoDuplicates [protected] |
Definition at line 86 of file SMW_SemanticData.php.
SMWSemanticData::$mSubject [protected] |
1.5.6