class CastSql

Same name in other branches
  1. 11.x 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

1 string reference to 'CastSql'
views.services.yml in core/modules/views/views.services.yml
core/modules/views/views.services.yml
1 service uses CastSql
views.cast_sql in core/modules/views/views.services.yml
Drupal\views\Plugin\views\query\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.