Skip to content

Commit

Permalink
Merge pull request #1014 from cakephp/dereuromark-patch-1
Browse files Browse the repository at this point in the history
3.x-bake-model-relations
  • Loading branch information
dereuromark authored Dec 9, 2024
2 parents f615076 + 0fc3664 commit 8673a0d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/en/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ You can get the list of available bake command by running ``bin/cake bake --help
To run a command, type `cake command_name [args|options]`
To get help on a specific command, type `cake command_name --help`

Bake Models
===========

Models are generically baked from the existing DB tables.
The conventions here apply, so it will detect relations based on ``thing_id`` foreign keys to ``things`` tables with their ``id`` primary keys.

For non-conventional relations, you can use references in the constraints / foreign key definitions for Bake to detect the relations, e.g.::

->addForeignKey('billing_country_id', 'countries') // defaults to `id`
->addForeignKey('shipping_country_id', 'countries', 'cid')


Bake Themes
===========

Expand Down

0 comments on commit 8673a0d

Please sign in to comment.