CastSql.php

Same filename in other branches
  1. 11.x core/modules/views/src/Plugin/views/query/CastSql.php

Namespace

Drupal\views\Plugin\views\query

File

core/modules/views/src/Plugin/views/query/CastSql.php

View source
<?php

namespace Drupal\views\Plugin\views\query;


/**
 * Cast handling in SQL.
 */
class CastSql implements CastSqlInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getFieldAsInt(string $field) : string {
        return "CAST({$field} AS INTEGER)";
    }

}

Classes

Title Deprecated Summary
CastSql Cast handling in SQL.

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