function flag_entity::get_content_id in Flag 7.2
Returns the entity id, if it already exists.
1 call to flag_entity::get_content_id()
- flag_entity::get_flag_action in ./
flag.inc - Returns a 'flag action' object.
1 method overrides flag_entity::get_content_id()
- flag_comment::get_content_id in ./
flag.inc - Returns the entity id, if it already exists.
File
- ./
flag.inc, line 1414 - Implements various flags. Uses object oriented style inspired by that of Views 2.
Class
- flag_entity
- Base entity flag handler.
Code
function get_content_id($entity) {
$entity_info = entity_get_info($this->content_type);
if ($entity && isset($entity->{$entity_info['entity keys']['id']})) {
return $entity->{$entity_info['entity keys']['id']};
}
}