本文整理汇总了PHP中MetadataDescription::getPropertyNames方法的典型用法代码示例。如果您正苦于以下问题:PHP MetadataDescription::getPropertyNames方法的具体用法?PHP MetadataDescription::getPropertyNames怎么用?PHP MetadataDescription::getPropertyNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MetadataDescription
的用法示例。
在下文中一共展示了MetadataDescription::getPropertyNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MetadataDescription
/**
* This implementation of the CrosswalkFilter
* simply removes statements from the incoming meta-data
* description that are not in the target description's schema.
* @see Filter::process()
* @param $input MetadataDescription
* @return MetadataDescription
*/
function &process(&$input)
{
// Create the target description
$output = new MetadataDescription($this->_toSchema);
// Compare the property names of the incoming description with
// the property names allowed in the target schema.
$sourceProperties = $input->getSetPropertyNames();
$targetProperties = $output->getPropertyNames();
$propertiesToBeRemoved = array_diff($sourceProperties, $targetProperties);
// Remove statements for properties that are not in the target schema.
$statements =& $input->getStatements();
foreach ($propertiesToBeRemoved as $propertyToBeRemoved) {
assert(isset($statements[$propertyToBeRemoved]));
unset($statements[$propertyToBeRemoved]);
}
// Set the remaining statements in the target description
$success = $output->setStatements($statements);
assert($success);
return $output;
}