MysqlCastSql.php

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

Namespace

Drupal\mysql\Plugin\views\query

File

core/modules/mysql/src/Plugin/views/query/MysqlCastSql.php

View source
<?php

namespace Drupal\mysql\Plugin\views\query;

use Drupal\views\Plugin\views\query\CastSqlInterface;

/**
 * MySQL specific cast handling.
 */
class MysqlCastSql implements CastSqlInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getFieldAsInt(string $field) : string {
        return "CAST({$field} AS UNSIGNED)";
    }

}

Classes

Title Deprecated Summary
MysqlCastSql MySQL specific cast handling.

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