From 090218b9035db51c0117355000cd43e1ededa6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Thu, 8 Dec 2016 11:03:32 +0100 Subject: [PATCH] Fill in class and property documentation based on Database Comments --- generators/model/Generator.php | 6 +++++- generators/model/default/model.php | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/generators/model/Generator.php b/generators/model/Generator.php index c9017e8f4..a43e6e1b6 100644 --- a/generators/model/Generator.php +++ b/generators/model/Generator.php @@ -260,7 +260,11 @@ private function generateProperties($table) } else { $type = $columnPhpType; } - $properties[$column->name] = $type; + $properties[$column->name] = [ + 'type' => $type, + 'name' => $column->name, + 'description' => $column->comment, + ]; } return $properties; diff --git a/generators/model/default/model.php b/generators/model/default/model.php index 4288333d5..17f179c38 100644 --- a/generators/model/default/model.php +++ b/generators/model/default/model.php @@ -22,10 +22,14 @@ use Yii; /** +comment): ?> + * comment, ["\n" => "\n * "]) . "\n" ?> + * This is the model class for table "generateTableName($tableName) ?>". + * - $type): ?> - * @property + $data): ?> + * @property ' ']) : '') . "\n" ?> *