You are here

function smart_paging_get_content_configuration in Smart Paging 7

Same name and namespace in other branches
  1. 7.2 smart_paging.module \smart_paging_get_content_configuration()

Helper function for grabbing Smart Paging content configuration.

1 call to smart_paging_get_content_configuration()
smart_paging_field_attach_view_alter in ./smart_paging.module
Implements hook_field_attach_view_alter().

File

./smart_paging.module, line 1750
Provides smart paging capability to Drupal contents.

Code

function smart_paging_get_content_configuration($entity_type, $entity_id) {
  $config =& drupal_static(__FUNCTION__);
  if (!isset($config)) {
    if (!empty($entity_type) && !empty($entity_id)) {

      // Retrieve the stored Smart Paging settings
      $query = db_select('smart_paging', 'sp')
        ->condition('sp.entity_id', $entity_id)
        ->condition('sp.entity_type', $entity_type)
        ->fields('sp', array(
        'configuration',
      ))
        ->execute();
      $config = unserialize($query
        ->fetchField(0));
    }
  }
  return $config;
}