Tuesday, December 29, 2009

Problem understanding how this model object works

I have a model object called "ImpresorasProducto" that belongs to a
NxM relationship table impresoras_productos.

When I'm in "ImpresorasProductosController" and debug the model object
it prints this:

ImpresorasProducto Object
(
[name] => ImpresorasProducto
[belongsTo] => Array
(
[Producto] => Array
(
[className] => Producto
[foreignKey] => producto_id
....

This is find because I can access al the realational models.

The problem is when I use the "ImpresorasProducto" model in other
controller.
I include the model in the controller with the var $uses ....
I can't acces the objects related to "ImpresorasProducto" and when I
debug the model object it prints this:

AppModel Object
(
[useDbConfig] => default
[useTable] => impresoras_productos
[displayField] => id
[id] =>
[data] => Array
(
)

[table] => impresoras_productos
....

I cant uderstand why here I have an AppModel Object instead of a
ImpresorasProducto Object

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: