WebformSubmissionCastToNumberTrait.php in Webform Views Integration 8.5
Namespace
Drupal\webform_views\Plugin\viewsFile
src/Plugin/views/WebformSubmissionCastToNumberTrait.phpView source
<?php
namespace Drupal\webform_views\Plugin\views;
/**
* Trait to cast a SQL expression to numeric data type.
*/
trait WebformSubmissionCastToNumberTrait {
/**
* Cast a given SQL snippet to data type expected by this handler.
*
* @param string $value
* SQL snippet that should be casted
*
* @return string
* SQL snippet that casts provided $value to necessary data type
*/
protected function castToDataType($value) {
return "({$value} + 0)";
}
}
Traits
Name | Description |
---|---|
WebformSubmissionCastToNumberTrait | Trait to cast a SQL expression to numeric data type. |