Skip to content

Commit

Permalink
Fill in class and property documentation based on Database Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelarnauts committed Dec 8, 2016
1 parent 1238a0c commit 7f7c267
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generators/model/default/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
use Yii;

/**
<?php if (property_exists($tableSchema, 'comment') && $tableSchema->comment): ?>
* <?= strtr($tableSchema->comment, ["\n" => "\n * "]) . "\n" ?>
<?php else: ?>
* This is the model class for table "<?= $generator->generateTableName($tableName) ?>".
<?php endif; ?>
*
<?php foreach ($tableSchema->columns as $column): ?>
* @property <?= "{$column->phpType} \${$column->name}\n" ?>
* @property <?= "{$column->phpType} \${$column->name}" . ($column->comment ? " " . strtr($column->comment, ["\n" => "\n * "]) : '') . "\n" ?>
<?php endforeach; ?>
<?php if (!empty($relations)): ?>
*
Expand Down

0 comments on commit 7f7c267

Please sign in to comment.