I'm currently prototyping a catalog, and got stumped by the following.
Notice I'm running cake beta 1.2.0.6311 on php 5.2.5 and mysql 5.0.51a-
community-nt on XP.
The name of the tables are in Spanish, and I'd prefer not to touch
them if at all possible.
The models:
Persona.php
<?php
class Persona extends AppModel {
var $name = 'Persona';
var $primaryKey = 'idpersona';
var $hasMany = array(
'Telefono' => array(
'foreignKey' => 'personas_idpersona',
),
'Email' => array(
'foreignKey' => 'personas_idpersona',
),
'SitioWeb' => array(
'foreignKey' => 'personas_idpersona',
),
);
}
?>
SitioWeb.php
<?php
class SitioWeb extends AppModel {
var $name = 'SitioWeb';
var $useTable = 'sitios_web';
var $primaryKey = 'idsitio_web';
var $belongsTo = array(
'Persona' => array(
'className' => 'Persona',
'foreignKey' =>
'personas_idpersona',
),
);
}
?>
-------------------
The controllers:
personas_controller.php
<?php
class PersonasController extends AppController {
var $scaffold;
}
?>
sitio_webs_controller.php
<?php
class SitioWebsController extends AppController {
var $scaffold;
}
?>
--------------
The errors:
Missing Database Table
Error: Database table sitio_webs for model SitioWeb was not found.
Why does it not use $useTable?
persistent is set to false in app/config/database.php
The other models and controllers work fine.
Addendum: changing the names to (respectively)
sitiowebs_controller.php, Sitioweb.php, Sitioweb (class name and
$name), SitiowebsController (class name) solves the issue. Could this
problem be due to the fact that Windows is case-insensitive?
TIA
--
Adriano
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---