Help command cake bake


I have table name “CMM_017”. I use command create Model but i cann’t create Model. Beause table name is special. Help me create with “cake bake model …”

i use phpcake 3.x


You can’t, you should create a similar table, bake it, and then modify acording you original table

@raul338 is correct, the cake console is designed to work primarily with databases that follow the cakephp database conventions. Your best bet is to use a template and manually enter in the table name and instance properties. Is this database being used with a legacy app? Is it possible to change the table name to something more conventional or would this lead to breaking other systems?

In the worst case decide on a Symbolic class name for the table, I’ll say CmmSeventeensTable and CmmSeventeen as the Entity and manually modify the cakephp table properties as in the code sample below.

You can find the cakephp conventions here

<!--  Table class  -->
class CmmSeventeensTable extends Table {
    public function initialize(array $config) {

        $this->table('CMM_017');  //  Keep as same case as in db engine for portability
        $this->displayField('column_name_act_as_display_in_lists');   //  generally kept as primary_key value
        //  Table associations

    //  Various methods

<!-- Entity  -->
class CmmSeventeen extends Entity
    protected $_accessible = [
        '*' => true,
        'primary_key' => false,