当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWDIProperty::getPredefinedPropertyTypeId方法代码示例

本文整理汇总了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;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:56,代码来源:SMW_SQLStore3.php

示例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;
 }
开发者ID:nischayn22,项目名称:SemanticMediawiki,代码行数:45,代码来源:SMW_SQLStore3.php


注:本文中的SMWDIProperty::getPredefinedPropertyTypeId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。