本文整理汇总了PHP中SMWDIProperty::getPredefinedPropertyTypeId方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWDIProperty::getPredefinedPropertyTypeId方法的具体用法?PHP SMWDIProperty::getPredefinedPropertyTypeId怎么用?PHP SMWDIProperty::getPredefinedPropertyTypeId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWDIProperty
的用法示例。
在下文中一共展示了SMWDIProperty::getPredefinedPropertyTypeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPropertyTables
/**
* Return the array of predefined property table declarations, initialising
* it if necessary. The result is an array of SMWSQLStore3Table objects
* indexed by table ids.
*
* It is ensured that the keys of the returned array agree with the name of
* the table that they refer to.
*
* @since 1.8
* @return SMWSQLStore3Table[]
*/
public static function getPropertyTables()
{
if (isset(self::$prop_tables)) {
return self::$prop_tables;
// Don't initialise twice.
}
/**
* @var SMWSQLStore3Table[] $propertyTables
*/
$propertyTables = array();
//tables for each DI type
foreach (self::$di_type_tables as $tableDIType => $tableName) {
$propertyTables[$tableName] = new SMWSQLStore3Table($tableDIType, $tableName);
}
//tables for special properties
foreach (self::$special_tables as $propertyKey) {
$typeId = SMWDIProperty::getPredefinedPropertyTypeId($propertyKey);
$diType = SMWDataValueFactory::getDataItemId($typeId);
$tableName = 'smw_fpt' . strtolower($propertyKey);
$propertyTables[$tableName] = new SMWSQLStore3Table($diType, $tableName, $propertyKey);
}
// Redirect table uses another subject scheme for historic reasons
// TODO This should be changed if possible
$propertyTables['smw_fpt_redi']->setUsesIdSubject(false);
// Get all the tables for the properties that are declared as fixed
// (overly used and thus having separate tables)
foreach (self::$fixedProperties as $propertyKey => $tableDIType) {
$tableName = 'smw_fpt_' . md5($propertyKey);
$propertyTables[$tableName] = new SMWSQLStore3Table($tableDIType, $tableName, $propertyKey);
}
wfRunHooks('SMWPropertyTables', array(&$propertyTables));
self::$prop_tables = $propertyTables;
// Build index for finding property tables
self::$fixedPropertyTableIds = array();
foreach (self::$prop_tables as $tid => $propTable) {
if ($propTable->isFixedPropertyTable()) {
self::$fixedPropertyTableIds[$propTable->getFixedProperty()] = $tid;
}
}
// Specifically set properties that must not be stored in any
// property table to null here. Any function that hits this
// null unprepared is doing something wrong anyway.
self::$fixedPropertyTableIds['_SKEY'] = null;
return self::$prop_tables;
}
示例2: getPropertyTables
/**
* Return the array of predefined property table declarations, initialising
* it if necessary. The result is an array of SMWSQLStore3Table objects
* indexed by table ids. Note that the ids are only for accessing the data
* and should not be assumed to agree with the table name.
*
* @return array of SMWSQLStore3Table
*/
public static function getPropertyTables()
{
if (isset(self::$prop_tables)) {
return self::$prop_tables;
// Don't initialise twice.
}
self::$prop_tables = array();
//tables for each DI type
foreach (self::$di_type_tables as $tableDIType => $tableName) {
self::$prop_tables[$tableName] = new SMWSQLStore3Table($tableDIType, $tableName);
}
//tables for special properties
foreach (self::$special_tables as $propertyKey) {
$typeId = SMWDIProperty::getPredefinedPropertyTypeId($propertyKey);
$diType = SMWDataValueFactory::getDataItemId($typeId);
$tableName = 'smw_fpt' . strtolower($propertyKey);
self::$prop_tables[$tableName] = new SMWSQLStore3Table($diType, $tableName, $propertyKey);
}
// Redirect table uses another subject scheme for historic reasons
// TODO This should be changed if possible
self::$prop_tables['smw_fpt_redi']->idsubject = false;
// Get all the tables for the properties that are declared as fixed
// (overly used and thus having separate tables)
foreach (self::$fixedProperties as $propertyKey => $tableDIType) {
$tableName = 'smw_fpt_' . md5($propertyKey);
self::$prop_tables[$tableName] = new SMWSQLStore3Table($tableDIType, $tableName, $propertyKey);
}
wfRunHooks('SMWPropertyTables', array(&self::$prop_tables));
// Build index for finding property tables
self::$fixedPropertyTableIds = array();
foreach (self::$prop_tables as $tid => $proptable) {
if ($proptable->fixedproperty) {
self::$fixedPropertyTableIds[$proptable->fixedproperty] = $tid;
}
}
return self::$prop_tables;
}