LoginSignup
0
0

More than 5 years have passed since last update.

DrupalでDBTNGを使った際に生成されるSQLを確認する

Last updated at Posted at 2016-06-15

メモするほどでもないけど、たまに使いたいんだよな...
ってことが過去に何度かあったためメモしておく。

  $query = db_select('draggableviews_structure', 'ds');
  $query->join('field_data_title_field', 'fdtf', 'ds.entity_id = fdtf.entity_id');
  $query->fields('ds', array('entity_id', 'weight'));
  $query->fields('fdtf', array('title_field_value'));
  $query->condition('fdtf.entity_type', 'node');
  $query->condition('fdtf.bundle', 'hoge');
  $query->condition('fdtf.deleted', 0);
  $query->condition('ds.view_name', 'piyo');
  $query->condition('ds.view_display', 'page');
  $query->condition('ds.args', json_encode($arguments));

  // here!!
  watchdog('DEBUG', $query->__toString(), array(), WATCHDOG_DEBUG);
  watchdog('DEBUG', dpr($query->getArguments(), TRUE), array(), WATCHDOG_DEBUG);

  $result = $query->execute()->fetchAll();
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0