ColumnSchema.php 610 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\db\mssql;
  8. /**
  9. * Class ColumnSchema for MSSQL database
  10. *
  11. * @since 2.0.23
  12. */
  13. class ColumnSchema extends \yii\db\ColumnSchema
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function phpTypecast($value)
  19. {
  20. if ($value !== null) {
  21. // convert from MSSQL column_default format, e.g. ('1') -> 1, ('string') -> string
  22. $value = trim($value, "'()");
  23. }
  24. return parent::phpTypecast($value);
  25. }
  26. }