function entity_metadata_comment_entity_property_info_alter

cis7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)
cle7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)
elmsmedia7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)
icor7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)
meedjum_blog7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)
mooc7 comment.info.inc entity_metadata_comment_entity_property_info_alter(&$info)

Implements hook_entity_property_info_alter() on top of comment module.

See also

entity_entity_property_info_alter()

File

sites/all/modules/ulmus/entity/modules/comment.info.inc, line 130
Provides info about the comment entity.

Code

function entity_metadata_comment_entity_property_info_alter(&$info) {
  // Add info about comment module related properties to the node entity.
  $properties = &$info['node']['properties'];
  $properties['comment'] = array(
    'label' => t("Comments allowed"),
    'description' => t("Whether comments are allowed on this node: 0 = no, 1 = closed (read only), 2 = open (read/write)."),
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer comments',
    'type' => 'integer',
  );
  $properties['comments'] = array(
    'label' => t("Comments"),
    'type' => 'list<comment>',
    'description' => t("The node comments."),
    'getter callback' => 'entity_metadata_comment_get_node_properties',
    'computed' => TRUE,
  );
  $properties['comment_count'] = array(
    'label' => t("Comment count"),
    'description' => t("The number of comments posted on a node."),
    'getter callback' => 'entity_metadata_comment_get_node_properties',
    'type' => 'integer',
  );
  $properties['comment_count_new'] = array(
    'label' => t("New comment count"),
    'description' => t("The number of comments posted on a node since the reader last viewed it."),
    'getter callback' => 'entity_metadata_comment_get_node_properties',
    'type' => 'integer',
  );

  // The comment body field is usually available for all bundles, so add it
  // directly to the comment entity.
  $info['comment']['properties']['comment_body'] = array(
    'type' => 'text_formatted',
    'label' => t('The main body text'),
    'getter callback' => 'entity_metadata_field_verbatim_get',
    'setter callback' => 'entity_metadata_field_verbatim_set',
    'property info' => entity_property_text_formatted_info(),
    'field' => TRUE,
    'required' => TRUE,
  );
  unset($info['comment']['properties']['comment_body']['property info']['summary']);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.