class MysqlCastSql

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

MySQL specific cast handling.

Hierarchy

  • class \Drupal\mysql\Plugin\views\query\MysqlCastSql implements \Drupal\views\Plugin\views\query\CastSqlInterface

Expanded class hierarchy of MysqlCastSql

2 files declare their use of MysqlCastSql
MysqlServiceProvider.php in core/modules/mysql/src/MysqlServiceProvider.php
ViewsTest.php in core/modules/mysql/tests/src/Kernel/mysql/ViewsTest.php
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
MysqlCastSql::getFieldAsInt public function

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