class CastSql

Same name and namespace in other branches
  1. 10 core/modules/views/src/Plugin/views/query/CastSql.php \Drupal\views\Plugin\views\query\CastSql

Cast handling in SQL.

Hierarchy

Expanded class hierarchy of CastSql

File

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

Namespace

Drupal\views\Plugin\views\query
View source
class CastSql implements CastSqlInterface {
  
  /**
   * {@inheritdoc}
   */
  public function getFieldAsInt(string $field) : string {
    return "CAST({$field} AS INTEGER)";
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
CastSql::getFieldAsInt public function Returns a database expression to cast the field to int. Overrides CastSqlInterface::getFieldAsInt

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