You are here

function word_link_load_by_url in Word Link 7.2

Loads word links by URL.

Parameters

string $url: Url string.

Return value

array Array with word link objects.

4 calls to word_link_load_by_url()
word_link_node_delete in ./word_link.module
Implements hook_node_delete().
word_link_path_delete in ./word_link.module
Implements hook_path_delete().
word_link_taxonomy_term_delete in ./word_link.module
Implements hook_taxonomy_term_delete().
word_link_user_delete in ./word_link.module
Implements hook_user_delete().

File

./word_link.module, line 614

Code

function word_link_load_by_url($url) {
  $url_alias = drupal_get_path_alias($url);
  $query = db_select('word_link', 'wl')
    ->fields('wl')
    ->condition(db_or()
    ->condition('url', $url, '=')
    ->condition('url', $url_alias, '='));
  $results = $query
    ->execute();
  $words = array();
  foreach ($results as $word) {
    $words[$word->id] = $word;
  }
  return $words;
}