You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 line
606B

  1. <?php
  2. /**
  3. * Creates a call for the method `yii\db\Migration::createTable()`
  4. */
  5. /* @var $table string the name table */
  6. /* @var $fields array the fields */
  7. /* @var $foreignKeys array the foreign keys */
  8. ?> $this->createTable('<?= $table ?>', [
  9. <?php foreach ($fields as $field):
  10. if (empty($field['decorators'])): ?>
  11. '<?= $field['property'] ?>',
  12. <?php else: ?>
  13. <?= "'{$field['property']}' => \$this->{$field['decorators']}" ?>,
  14. <?php endif;
  15. endforeach; ?>
  16. ]);
  17. <?= $this->render('_addForeignKeys', [
  18. 'table' => $table,
  19. 'foreignKeys' => $foreignKeys,
  20. ]);