You are here

function LinkitViewsPlugin::populate_tmp_table in Linkit views 7.2

Populate the temporary table with display name and path.

1 call to LinkitViewsPlugin::populate_tmp_table()
LinkitViewsPlugin::autocomplete_callback in plugins/linkit_plugins/linkit_views.class.php
The autocomplete callback function for the Linkit Entity plugin.

File

plugins/linkit_plugins/linkit_views.class.php, line 37

Class

LinkitViewsPlugin
Plugin class.

Code

function populate_tmp_table() {

  // Get all displays that is "page" and their path
  $query = db_select('views_view', 'w')
    ->condition('wd.display_plugin', 'page')
    ->fields('wd', array(
    'display_options',
    'display_title',
  ))
    ->fields('w', array(
    'human_name',
  ));
  $query
    ->join('views_display', 'wd', 'w.vid = wd.vid');
  $result = $query
    ->execute();
  foreach ($result as $view) {
    $optinos = unserialize($view->display_options);
    $fields = array(
      'display_title' => $view->display_title,
      'human_name' => $view->human_name,
      'path' => $optinos['path'],
    );
    db_insert($this->table_name)
      ->fields($fields)
      ->execute();
  }
}