MysqlDateSql::$replace

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::replace
  2. 10 core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::replace
  3. 11.x core/modules/views/src/Plugin/views/query/MysqlDateSql.php \Drupal\views\Plugin\views\query\MysqlDateSql::replace

An array of PHP-to-MySQL replacement patterns.

Type: replace

File

core/modules/views/src/Plugin/views/query/MysqlDateSql.php, line 27

Class

MysqlDateSql
MySQL-specific date handling.

Namespace

Drupal\views\Plugin\views\query

Code

protected static $replace = [
    'Y' => '%Y',
    'y' => '%y',
    'M' => '%b',
    'm' => '%m',
    'n' => '%c',
    'F' => '%M',
    'D' => '%a',
    'd' => '%d',
    'l' => '%W',
    'j' => '%e',
    'W' => '%v',
    'H' => '%H',
    'h' => '%h',
    'i' => '%i',
    's' => '%s',
    'A' => '%p',
];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.