function social_content_post_exists in Social Content 7
Check for existing content.
Return value
bool Existing content was found.
1 call to social_content_post_exists()
- social_content_import_data in ./
social_content.module - Go through the posts and process each one.
File
- ./
social_content.module, line 299 - Social Content module.
Code
function social_content_post_exists($external_id, $social_content_type, $langcode) {
$field_name = current($social_content_type['external_id_field_mapping']);
$query = new EntityFieldQuery();
$result = $query
->entityCondition('entity_type', 'node')
->propertyCondition('type', $social_content_type['content_type'])
->propertyCondition('language', $langcode)
->fieldCondition($field_name, 'value', $external_id)
->execute();
if (!empty($result)) {
return TRUE;
}
return FALSE;
}