From 7117a6752b6927038b62e2366d9034b282b3ced0 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sun, 2 Jun 2013 22:58:42 +0200 Subject: [PATCH] Added phpdoc about precision constraints for abstract db types --- framework/yii/db/QueryBuilder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/yii/db/QueryBuilder.php b/framework/yii/db/QueryBuilder.php index 3e7f95a..46457c6 100644 --- a/framework/yii/db/QueryBuilder.php +++ b/framework/yii/db/QueryBuilder.php @@ -464,7 +464,11 @@ class QueryBuilder extends \yii\base\Object * the first part will be converted, and the rest of the parts will be appended to the converted result. * For example, 'string NOT NULL' is converted to 'varchar(255) NOT NULL'. * - // TODO documentation + * For some of the abstract types you can also specify a length or precision constraint + * by prepending it in round brackets directly to the type. + * For example `string(32)` will be converted into "varchar(32)" on a MySQL database. + * If the underlying DBMS does not support these kind of constraints for a type it will + * be ignored. * * If a type cannot be found in [[typeMap]], it will be returned without any change. * @param string $type abstract column type