You are here

function fb_instant_articles_rss_set_entity in Facebook Instant Articles 7

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

Sets the entity as a Facebook Instant Article.

Parameters

int $id: The entity id.

2 calls to fb_instant_articles_rss_set_entity()
fb_instant_articles_rss_mass_update in modules/fb_instant_articles_rss/fb_instant_articles_rss.module
Makes mass update of fia_enabled status for selected nodes.
fb_instant_articles_rss_node_form_submit in modules/fb_instant_articles_rss/fb_instant_articles_rss.module
Submit callback for node form.

File

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

Code

function fb_instant_articles_rss_set_entity($id, $enabled) {
  db_merge('fb_instant_articles_rss_entity_settings')
    ->key(array(
    'entity_id' => $id,
  ))
    ->fields(array(
    'entity_id' => $id,
    'fia_enabled' => $enabled,
  ))
    ->execute();

  // Allow other modules to perform actions.
  module_invoke_all('fb_instant_articles_rss_set_entity', $id, $enabled);
}