Here is my database structure:
create table dpt_tutores
(
id int primary key AUTO_INCREMENT,
nivel varchar(128),
apellidos varchar(256),
nombres varchar(256),
email varchar(512),
estado varchar(128)
);
create table dpt_grupos
(
id int primary key AUTO_INCREMENT,
fecha_de_creacion datetime,
alumnos varchar(512),
titulo varchar(1024),
id_curso int,
informe_nota decimal(5,2),
informe_rango varchar(16),
predefensa_fecha datetime,
predefensa_gmt varchar(16),
predefensa_webex varchar(16),
defensa_fecha datetime,
defensa_gmt varchar(16),
defensa_webex varchar(16),
id_revisor int,
FOREIGN KEY (id_revisor) REFERENCES dpt_tutores(id),
id_guia int,
FOREIGN KEY (id_guia) REFERENCES dpt_tutores(id)
);
create table dpt_grupos_iteraciones
(
id int primary key AUTO_INCREMENT,
fecha datetime,
ubicacion_archivo varchar(512),
nota float(4,2),
id_grupo int,
FOREIGN KEY (id_grupo) REFERENCES dpt_grupos(id)
);
I’ve added the following Model (dpt_grupo.php):
<?php
class DptGrupo extends AppModel {
}
And my controller:
<?php
class DptController extends AppController {
public $helpers = array('Html', 'Form');
public function index() {
$this->loadModel('Dpt_Grupo');
$this->set('grupos', $this->dpt_grupo->find('all'));
}
}
But when I run the action in that controller I get the error:
Fatal Error Error: Cannot redeclare class DptGrupo File:
C:\xampp\htdocs\foowebsite\app\Model\dpt_grupo.php Line: 4Notice: If you want to customize this error message, create
app\View\Errors\fatal_error.ctp
How can I just find a list of all the rows in the dpt_grupos table?
Rename the model file to
DptGrupo.php