function RulesData::addSiteMetadata
Property info alter callback for the entity metadata wrapper.
Used to inject metadata for the 'site' variable. In contrast to doing this via hook_rules_data_info() this callback makes use of the already existing property info cache for site information of entity metadata.
See also
RulesPlugin::availableVariables()
File
-
includes/
rules.state.inc, line 658
Class
- RulesData
- A class holding static methods related to data.
Code
public static function addSiteMetadata(EntityMetadataWrapper $wrapper, $property_info) {
$site_info = entity_get_property_info('site');
$property_info['properties'] += $site_info['properties'];
// Also invoke the usual callback for altering metadata, in case actions
// have specified further metadata.
return RulesData::applyMetadataAssertions($wrapper, $property_info);
}