comment_entity_info

Versions
7
comment_entity_info()

Implements hook_entity_info().

Code

modules/comment/comment.module, line 94

<?php
function comment_entity_info() {
  $return =  array(
    'comment' => array(
      'label' => t('Comment'),
      'base table' => 'comment',
      'fieldable' => TRUE,
      'controller class' => 'CommentController',
      'object keys' => array(
        'id' => 'cid',
        'bundle' => 'node_type',
      ),
      'bundle keys' => array(
        'bundle' => 'type',
      ),
      'bundles' => array(),
      'static cache' => FALSE,
    ),
  );

  foreach (node_type_get_names() as $type => $name) {
    $return['comment']['bundles']['comment_node_' . $type] = array(
      'label' => $name,
    );
  }

  return $return;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.