本文整理汇总了PHP中SMWDIProperty::getPropertyTypeID方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWDIProperty::getPropertyTypeID方法的具体用法?PHP SMWDIProperty::getPropertyTypeID怎么用?PHP SMWDIProperty::getPropertyTypeID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWDIProperty
的用法示例。
在下文中一共展示了SMWDIProperty::getPropertyTypeID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPropertyValues
public function getPropertyValues($subject, SMWDIProperty $property, $requestoptions = null, $outputformat = '')
{
wfProfileIn("SMWSQLStoreLight::getPropertyValues (SMW)");
if ($property->isInverse()) {
// inverses are working differently
$noninverse = clone $property;
$noninverse->setInverse(false);
$result = $this->getPropertySubjects($noninverse, $subject, $requestoptions);
} elseif ($subject !== null) {
// subject given, use semantic data cache:
$sd = $this->getSemanticData($subject, array($property->getPropertyTypeID()));
$result = $this->applyRequestOptions($sd->getPropertyValues($property), $requestoptions);
if ($outputformat !== '') {
// reformat cached values
$newres = array();
foreach ($result as $dv) {
$ndv = clone $dv;
$ndv->setOutputFormat($outputformat);
$newres[] = $ndv;
}
$result = $newres;
}
} else {
// no subject given, get all values for the given property
$tablename = SMWSQLStoreLight::findPropertyTableName($property);
$db = wfGetDB(DB_SLAVE);
$res = $db->select($tablename, array('value'), array('propname' => $property->getDBkey()), 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions, 'value') + array('DISTINCT'));
$result = array();
foreach ($res as $row) {
$dv = SMWDataValueFactory::newPropertyObjectValue($property);
if ($outputformat !== '') {
$dv->setOutputFormat($outputformat);
}
$dv->setDBkeys($tablename == 'smwsimple_special' ? array($row->value) : unserialize($row->value));
$result[] = $dv;
}
$db->freeResult($res);
}
wfProfileOut("SMWSQLStoreLight::getPropertyValues (SMW)");
return $result;
}