class MysqlCastSql

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

MySQL specific cast handling.

Hierarchy

Expanded class hierarchy of MysqlCastSql

1 string reference to 'MysqlCastSql'
mysql.services.yml in core/modules/mysql/mysql.services.yml
core/modules/mysql/mysql.services.yml
1 service uses MysqlCastSql
mysql.views.cast_sql in core/modules/mysql/mysql.services.yml
Drupal\mysql\Plugin\views\query\MysqlCastSql

File

core/modules/mysql/src/Plugin/views/query/MysqlCastSql.php, line 10

Namespace

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

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
MysqlCastSql::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.