You are here

function ad_types in Advertisement 7.2

Returns an array of ad type objects keyed by type.

4 calls to ad_types()
ad_field_extra_fields in ./ad.module
Implements hook_field_extra_fields().
ad_type_get_name in ./ad.module
Returns the human readable name of any or all ad types.
ad_ui_add_any_access in ./ad_ui.module
Access callback: determine if the user can create any type of ad.
ad_ui_types_overview in includes/ad_ui.types.inc
Menu callback: display an overview of available types.
1 string reference to 'ad_types'
ad_types_reset in ./ad.module
Resets the cached list of ad types.

File

./ad.module, line 227
Defines the core ad entity, including the entity itself, the bundle definitions (ad types), and various API functions to manage ads and interact with them through forms and autocompletes.

Code

function ad_types() {

  // First check the static cache for an ad types array.
  $ad_types =& drupal_static(__FUNCTION__);

  // If it did not exist, fetch the types now.
  if (!isset($ad_types)) {
    $ad_types = db_query('SELECT * FROM {ad_type}')
      ->fetchAllAssoc('type');
  }
  return $ad_types;
}