1 date_views_plugin_pager.inc public date_views_plugin_pager::set_argument_placeholders($placeholders, $mindate, $maxdate, $query, $format)

Set the view's argument placeholders.

File

core/modules/date/views/date_views_plugin_pager.inc, line 321
Date views pager plugin.

Class

date_views_plugin_pager
Date views pager plugin.

Code

public function set_argument_placeholders($placeholders, $mindate, $maxdate, $query, $format) {
  $count = count($placeholders);
  foreach ($query->where as $group => $data) {
    foreach ($data['conditions'] as $delta => $condition) {
      if (array_key_exists('value', $condition) && is_array($condition['value'])) {
        foreach ($condition['value'] as $placeholder => $placeholder_value) {
          if (array_key_exists($placeholder, $placeholders)) {
            // If we didn't get a match, this is a > $min < $max query
            // that uses the view min and max dates as placeholders.
            $date = ($count == 2) ? $mindate : $maxdate;
            $next_placeholder = array_shift($placeholders);
            $query->where[$group]['conditions'][$delta]['value'][$placeholder] = $date->format($format);
            $count--;
          }
        }
      }
    }
  }
}