You are here

function fb_instant_articles_rss_is_article in Facebook Instant Articles 7.2

Same name and namespace in other branches
  1. 7 modules/fb_instant_articles_rss/fb_instant_articles_rss.module \fb_instant_articles_rss_is_article()

Checks to see if an entity is a Facebook Instant Article.

Parameters

string $entity_id: The entity id.

Return value

bool Boolean TRUE or FALSE.

1 call to fb_instant_articles_rss_is_article()
fb_instant_articles_rss_form_node_form_alter in modules/fb_instant_articles_rss/fb_instant_articles_rss.module
Implements hook_form_BASE_FORM_ID_alter().

File

modules/fb_instant_articles_rss/fb_instant_articles_rss.module, line 104
Facebook Instant Articles RSS module.

Code

function fb_instant_articles_rss_is_article($entity_id) {
  $is_type = FALSE;
  $results = db_select('fb_instant_articles_rss_entity_settings', 'fiaes')
    ->fields('fiaes', array(
    'fia_enabled',
  ))
    ->condition('entity_id', $entity_id)
    ->execute();
  if (!$results
    ->rowCount()) {
    $is_type = variable_get('fb_instant_articles_rss_all_enabled_default', TRUE);
  }
  else {
    $is_type = $results
      ->fetch()->fia_enabled;
  }

  // Allow other modules to alter.
  drupal_alter('fb_instant_articles_rss_is_article', $is_type, $entity_id);
  return $is_type;
}