You are here

function newsletter_entity_info in Newsletter 7

Same name and namespace in other branches
  1. 7.2 newsletter.module \newsletter_entity_info()

Implements hook_entity_info().

File

./newsletter.module, line 783
Defines menu items for newsletter administration, permissions and basic drupal hooks.

Code

function newsletter_entity_info() {
  $return = array(
    'newsletter_subscriber' => array(
      'label' => t('Newsletter subscriber'),
      'controller class' => 'NewsletterSubscriberController',
      'access callback' => 'newsletter_entity_access',
      'base table' => 'newsletter_subscriber',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'nsid',
        'label' => 'email',
      ),
      'bundles' => array(
        'newsletter_subscriber' => array(
          'label' => t('Newsletter subscriber'),
          'admin' => array(
            'path' => 'admin/config/media/newsletter/subscribers',
            'access arguments' => array(
              'administer newsletters',
            ),
          ),
        ),
      ),
    ),
    'newsletter_list' => array(
      'label' => t('Newsletter list'),
      'controller class' => 'NewsletterListController',
      'access callback' => 'newsletter_entity_access',
      'base table' => 'newsletter_list',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'nlid',
        'label' => 'title',
      ),
      'bundles' => array(
        'newsletter_list' => array(
          'label' => t('Newsletter list'),
        ),
      ),
    ),
    'newsletter_template' => array(
      'label' => t('Newsletter template'),
      'controller class' => 'NewsletterTemplateController',
      'access callback' => 'newsletter_entity_access',
      'base table' => 'newsletter_template',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'ntid',
        'label' => 'subject',
      ),
      'bundles' => array(
        'newsletter_template' => array(
          'label' => t('Newsletter template'),
          'admin' => array(
            'path' => 'admin/config/media/newsletter/templates',
            'access arguments' => array(
              'administer newsletters',
            ),
          ),
        ),
      ),
    ),
    'newsletter_newsletter' => array(
      'label' => t('Newsletter'),
      'controller class' => 'NewsletterNewsletterController',
      'access callback' => 'newsletter_entity_access',
      'base table' => 'newsletter_newsletter',
      'fieldable' => TRUE,
      'entity keys' => array(
        'id' => 'nnid',
        'label' => 'title',
      ),
      'bundles' => array(
        'newsletter_newsletter' => array(
          'label' => t('Newsletter'),
        ),
      ),
    ),
  );
  return $return;
}