Reputation: 233
I am migrating a cakephp1.3 application in cakephp 2.x. Midway through development, I suddenly found myself with a "table not found" error.
In cakephp 1.3 lower case format for ,file name & also allow underscore between two words But as I have read documentation now only CAMEL format has allowed for naming convention.
I have a db file name "case__studies" previously we were using models/case_study.php
<?php
class Case_Study extends AppModel {
var $name = 'Case_Study';
var $actsAs = array('Multivalidatable');
var $belongsTo = array('User');
}
?>
but now according to new structure I have changed name of file Model/CaseStudy.php
and code for this file
<?php
App::uses('AppModel', 'Model');
class CaseStudy extends AppModel {
var $name = 'CaseStudy';
var $actsAs = array('Multivalidatable');
var $belongsTo = array('User');
}
?>
Upvotes: 1
Views: 2018
Reputation: 163
Make sure that you cleared/disabled cache after any changes in the model layer.
You won't need that "name" property.
Upvotes: 1