mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 10:39:59 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			41 lines
		
	
	
		
			903 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			903 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| /**
 | |
|  * @link https://www.yiiframework.com/
 | |
|  * @copyright Copyright (c) 2008 Yii Software LLC
 | |
|  * @license https://www.yiiframework.com/license/
 | |
|  */
 | |
| 
 | |
| namespace yii\db\mssql;
 | |
| 
 | |
| /**
 | |
|  * Class ColumnSchema for MSSQL database
 | |
|  *
 | |
|  * @since 2.0.23
 | |
|  */
 | |
| class ColumnSchema extends \yii\db\ColumnSchema
 | |
| {
 | |
|     /**
 | |
|      * @var bool whether this column is a computed column
 | |
|      * @since 2.0.39
 | |
|      */
 | |
|     public $isComputed;
 | |
| 
 | |
| 
 | |
|     /**
 | |
|      * Prepares default value and converts it according to [[phpType]]
 | |
|      * @param mixed $value default value
 | |
|      * @return mixed converted value
 | |
|      * @since 2.0.24
 | |
|      */
 | |
|     public function defaultPhpTypecast($value)
 | |
|     {
 | |
|         if ($value !== null) {
 | |
|             // convert from MSSQL column_default format, e.g. ('1') -> 1, ('string') -> string
 | |
|             $value = substr(substr($value, 2), 0, -2);
 | |
|         }
 | |
| 
 | |
|         return parent::phpTypecast($value);
 | |
|     }
 | |
| }
 | 
