function CastSql::getFieldAsInt

Same name in other branches
  1. 11.x core/modules/views/src/Plugin/views/query/CastSql.php \Drupal\views\Plugin\views\query\CastSql::getFieldAsInt()

Overrides CastSqlInterface::getFieldAsInt

File

core/modules/views/src/Plugin/views/query/CastSql.php, line 13

Class

CastSql
Cast handling in SQL.

Namespace

Drupal\views\Plugin\views\query

Code

public function getFieldAsInt(string $field) : string {
    return "CAST({$field} AS INTEGER)";
}

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