Perhaps try:

    var $belongsTo = array(

(Note the 's' in there!)

Mauro wrote:
> Hi,
> I am having some problems with belongTo,
> here is my code:
>
> Model:
>
> <?php
>       class Document extends AppModel
>       {
>
>               var $belongTo= array(
>
>                       'Recorder' =>
>                         array('className'    => 'Recorder',
>                               'conditions'   => '',
>                               'order'        => '',
>                               'dependent'    =>  true,
>                               'foreignKey'   => 'recorder_id'
>                  );
>       }
>
> ?>
>
> <?php
>       class Recorder extends AppModel
>       {
>
>       }
> ?>
>
> Table:
>
> DROP TABLE IF EXISTS `recorders`;
>
> CREATE TABLE `recorders` (
>
>   `id` int(10) unsigned NOT NULL auto_increment,
>
>   `titulo` varchar(45) NOT NULL,
>
>   `fecha_desde` datetime NOT NULL COMMENT 'fecha minima de creacion de
> documentos a archivar en el bibliorato',
>
>   `fecha_hasta` datetime default NULL COMMENT 'fecha maxima de
> creacion de documentos a archivar en el bibliorato',
>
>   PRIMARY KEY  (`id`)
>
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
>
> ROP TABLE IF EXISTS `documents`;
>
> CREATE TABLE `documents` (
>
>   `id` int(10) unsigned NOT NULL auto_increment,
>   `recorder_id` int(10) unsigned NOT NULL COMMENT 'Id de bibliorato en
> que este documento esta almacenado. Si es NULL, el documento no esta
> archivado',
>
>   `proposito` int(10) unsigned NOT NULL COMMENT 'Representa el
> proposito compuesto del documento (solicitud [notificacion], respuesta
> [notificacion]). El bit mas bajo es solicitud, el siguiente es
> respuesta y el 3ero es notificacion',
>
>   `tipo` int(10) unsigned NOT NULL COMMENT '1: Nota, 2: Memo, 3:
> Resolucion, 4: Expediente.',
>
>   `fecha_creacion` datetime NOT NULL,
>
>   `asunto` varchar(500) NOT NULL,
>
>   `observacion` varchar(1000) default NULL,
>
>   `despacho` int(10) unsigned NOT NULL COMMENT 'De intercambio (1) o
> providencia (2). Tiene relacion con el campo TIPO',
>
>   `tipo_resolucion` int(10) unsigned default NULL COMMENT '(Solo si
> TIPO = Resolucion). De Decano (1), Consejo Directivo (2), Rector (3),
> Consejo Superior (4)',
>
>   `numero_resolucion` varchar(50) default NULL COMMENT '(Solo si TIPO
> = Resolucion).',
>
>   `numero_expediente` varchar(50) default NULL COMMENT '(Solo si TIPO
> = Expediente). No es el ID de expediente, es el numero interno de la
> facultad que le asigna al expediente.',
>
>   `fecha_ingreso` datetime default NULL COMMENT 'fecha de ingreso del
> documento a la dependencia',
>
>   `fecha_egreso` datetime default NULL COMMENT 'fecha de egreso del
> documento de la dependencia.',
>
>
>
>   PRIMARY KEY  (`id`)
>
>
>
> ) ;
>
> The problem is that cake doesn't make the association between tables,
> when I do:
>
> $this->set('doc', $this->Document->read(null, '1'))  ;
> <?php print_r($doc)?>
>
> Output:
>  Array ( [Document] => Array ( [id] => 1 [recorder_id] => 1
> [proposito] => 0 [tipo] => 0 [fecha_creacion] => 0000-00-00 00:00:00
> [asunto] => as [observacion] => as [despacho] => 0 [tipo_resolucion]
> => [numero_resolucion] => [numero_expediente] => [fecha_ingreso] =>
> 0000-00-00 00:00:00 [fecha_egreso] => 0000-00-00 00:00:00 )
>
> No recorder data, only its id
>
> I hope someone can help me with this problem,
> Thank you very much and sorry about my english, it is no good
>
>
> >
>   


 
-- 
Joshua Benner
http://bennerweb.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to