You are here

function follow_link_save in Follow 7.2

Same name and namespace in other branches
  1. 5 follow.module \follow_link_save()
  2. 6 follow.module \follow_link_save()
  3. 7 follow.module \follow_link_save()

Inserts a new link, or updates an existing one.

Parameters

$link: A link object to be saved.

1 call to follow_link_save()
follow_links_form_submit in ./follow.module
Submit handler for the follow_links_form.

File

./follow.inc, line 271
Follow module API and helper functions.

Code

function follow_link_save($link) {
  $parsed = follow_parse_url($link->url);
  $link->path = $parsed['path'];
  $link->options = $parsed['options'];
  if (isset($link->lid)) {
    drupal_write_record('follow_links', $link, 'lid');
  }
  else {
    drupal_write_record('follow_links', $link);
  }
  return $link;
}