Inherits SMWDataItem.
Public Member Functions | |
| __construct (SMWContainerSemanticData $semanticData) | |
| Constructor. | |
| getDIType () | |
| Convenience method that returns a constant that defines the concrete class that implements this data item. | |
| getSemanticData () | |
| getSortKey () | |
| Return a value that can be used for sorting data of this type. | |
| getSerialization () | |
| Get a UTF-8 encoded string serialization of this data item. | |
| getHash () | |
| Get a hash string for this data item. | |
Static Public Member Functions | |
| static | doUnserialize ($serialization) |
| Create a data item from the provided serialization string and type ID. | |
Protected Attributes | |
| $m_semanticData | |
Containers are not dataitems in the proper sense: they do not represent a single, opaque value that can be assigned to a property. Rather, a container represents a "subobject" with a number of property-value assignments. When a container is stored, these individual data assignments are stored -- the data managed by SMW never contains any "container", just individual property assignments for the subobject. Likewise, when a container is used in search, it is interpreted as a patterns of possible property assignments, and this pattern is searched for.
The data encapsulated in a container data item is essentially an SMWSemanticData object of class SMWContainerSemanticData. This class allows the subject to be kept anonymous if not known (if no context page is available for finding a suitable subobject name). See the repsective documentation for details.
Being a mere placeholder/template for other data, an SMWDIContainer is not immutable as the other basic data items. New property-value pairs can always be added to the internal SMWContainerSemanticData.
Definition at line 130 of file SMW_DI_Container.php.
| SMWDIContainer::__construct | ( | SMWContainerSemanticData $ | semanticData | ) |
Constructor.
The given SMWContainerSemanticData object will be owned by the constructed object afterwards, and in particular will not allow further changes.
| $semanticData | SMWContainerSemanticData |
Definition at line 146 of file SMW_DI_Container.php.
| SMWDIContainer::getDIType | ( | ) |
Convenience method that returns a constant that defines the concrete class that implements this data item.
Used to switch when processing data items.
Reimplemented from SMWDataItem.
Definition at line 150 of file SMW_DI_Container.php.
References SMWDataItem::TYPE_CONTAINER.
| SMWDIContainer::getSemanticData | ( | ) |
Definition at line 154 of file SMW_DI_Container.php.
| SMWDIContainer::getSortKey | ( | ) |
Return a value that can be used for sorting data of this type.
If the data is of a numerical type, the sorting must be done in numerical order. If the data is a string, the data must be sorted alphabetically.
Wiki pages are a special case in SMW. They are ordered by a sortkey that is assigned to them as a property value. When pages are sorted, this data should be used if possible.
Reimplemented from SMWDataItem.
Definition at line 158 of file SMW_DI_Container.php.
| SMWDIContainer::getSerialization | ( | ) |
Get a UTF-8 encoded string serialization of this data item.
The serialisation should be concise and need not be pretty, but it must allow unserialization. Each subclass of SMWDataItem implements a static method doUnserialize() for this purpose.
Reimplemented from SMWDataItem.
Definition at line 162 of file SMW_DI_Container.php.
| SMWDIContainer::getHash | ( | ) |
Get a hash string for this data item.
Reimplemented from SMWDataItem.
Definition at line 171 of file SMW_DI_Container.php.
| static SMWDIContainer::doUnserialize | ( | $ | serialization | ) | [static] |
Create a data item from the provided serialization string and type ID.
TODO May issue an E_NOTICE when problems occur; catch this
Definition at line 181 of file SMW_DI_Container.php.
SMWDIContainer::$m_semanticData [protected] |
Definition at line 137 of file SMW_DI_Container.php.
1.5.6