Re: Problem with HBTM tables. (included image)

2009-08-05 Thread Carlos Suarez Fontalvo

David I have one more question. when you said that is "The PK in this
model", it is really the PK or the FK. I have this doubt

On 28 jul, 16:17, Carlos Suarez Fontalvo 
wrote:
> tnx david, i'll do that tonight. ihopethis works. I think weall
> need to do an example biblio of this really nasty troubles.
>
> On Jul 28, 11:52 am, DavidH  wrote:
>
> > Hi Carlos
>
> > Why can't you follow the standard HABTM setup by inserting thenames
> > of you key columns where appropriate? Something like:
>
> > class Modulo extends AppModel {
> > 
> > var $hasAndBelongsToMany = array(
> >   'TipoUsuario' => array(
> >     'classname' => 'TipoUsuario',
> >     'foreignKey' => 'modulo', // The PK column in this model
> >     'associationForeignKey' => 'tipousauario', // The PK column in the
> > other model
> >     'joinTable' => 'TipoUsuarioModulo'
> >   )
> > );
>
> > In your TipoUsuario model you'll have a similar HABTM definition with
> > the same joinTable; but the other fields replaced by their modulo
> > equivalents.
>
> > Ihopethis works for you.
>
> > Regards
>
> > David
>
> >PSIhopeI'vespeltallthefieldnamescorrectly.
>
> > On Jul 28, 5:00 pm, Carlos Suarez Fontalvo
>
> >  wrote:
> > > Hello, tnx for the ans, but, i already put the images in my questions,
> > > and about that, what i need is precisely that data (i need to know for
> > > a HABTM relationship the jointable, foreignkey, assforkey) for doing
> > > the rest.
>
> > > I apreciate your help.
>
> > > On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
>
> > > > Hello,
>
> > > > > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > > > > tnx a lot.
>
> > > > In this case I'm pretty sure that you have to define additional HABTM
> > > > keys in TipoUsuario and Modulo - I mean:
> > > > joinTable, foreignKey, associationForeignKey. Just get one model
> > > > association working 1st, and then you'll get the pattern.
>
> > > > HTH
>
> > > > Regards,
> > > > Piotr
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Contain HABTM

2009-08-05 Thread Carlos Suarez Fontalvo

Excuse me, but pliz add some details, we are not sorcerers.

On 5 ago, 14:58, "Dave Maharaj :: WidePixels.com"
 wrote:
> Is it possable to use contain to find HABTM data?
>
> I have
>
> Posts
> Amenities
> Posts_Amenities
>
> So I need a simple function to pull some user info and thier HABTM Amenities
>
> Dave
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with HBTM tables. (included image)

2009-07-28 Thread Carlos Suarez Fontalvo

tnx david, i'll do that tonight. i hope this works. I think we all
need to do an example biblio of this really nasty troubles.

On Jul 28, 11:52 am, DavidH  wrote:
> Hi Carlos
>
> Why can't you follow the standard HABTM setup by inserting the names
> of you key columns where appropriate? Something like:
>
> class Modulo extends AppModel {
> 
> var $hasAndBelongsToMany = array(
>   'TipoUsuario' => array(
>     'classname' => 'TipoUsuario',
>     'foreignKey' => 'modulo', // The PK column in this model
>     'associationForeignKey' => 'tipousauario', // The PK column in the
> other model
>     'joinTable' => 'TipoUsuarioModulo'
>   )
> );
>
> In your TipoUsuario model you'll have a similar HABTM definition with
> the same joinTable; but the other fields replaced by their modulo
> equivalents.
>
> I hope this works for you.
>
> Regards
>
> David
>
> PS I hope I've spelt all the field names correctly.
>
> On Jul 28, 5:00 pm, Carlos Suarez Fontalvo
>
>  wrote:
> > Hello, tnx for the ans, but, i already put the images in my questions,
> > and about that, what i need is precisely that data (i need to know for
> > a HABTM relationship the jointable, foreignkey, assforkey) for doing
> > the rest.
>
> > I apreciate your help.
>
> > On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
>
> > > Hello,
>
> > > > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > > > tnx a lot.
>
> > > In this case I'm pretty sure that you have to define additional HABTM
> > > keys in TipoUsuario and Modulo - I mean:
> > > joinTable, foreignKey, associationForeignKey. Just get one model
> > > association working 1st, and then you'll get the pattern.
>
> > > HTH
>
> > > Regards,
> > > Piotr
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with HBTM tables. (included image)

2009-07-28 Thread Carlos Suarez Fontalvo

Hello, tnx for the ans, but, i already put the images in my questions,
and about that, what i need is precisely that data (i need to know for
a HABTM relationship the jointable, foreignkey, assforkey) for doing
the rest.

I apreciate your help.

On Jul 27, 3:17 pm, Piotr Kilczuk  wrote:
> Hello,
>
> > Excuse me, but, nobody has answer me. It's anyone here can help me?.
> > tnx a lot.
>
> In this case I'm pretty sure that you have to define additional HABTM
> keys in TipoUsuario and Modulo - I mean:
> joinTable, foreignKey, associationForeignKey. Just get one model
> association working 1st, and then you'll get the pattern.
>
> HTH
>
> Regards,
> Piotr
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with HBTM tables. (included image)

2009-07-27 Thread Carlos Suarez Fontalvo

Excuse me, but, nobody has answer me. It's anyone here can help me?.
tnx a lot.
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Using CakePHP-bake , some of the database table names get changed in model files...why is it so?

2009-07-24 Thread Carlos Suarez Fontalvo

I'm not understanding you. But, it seems you are not using the bake
shell properly.
In linux you must type: cakbe bake or cake bake model, and when it
asks for params lets say name of the table (is the name cake expect
the table might have). but if your table doesnt follow cakephp
conventions, you must type the correct name of the table for that
model. for example: If you have a table called user, cake in the
command: cake bake model, must expect that your table should be name
as "users", instead of "user", so if this happen, your are obligated
to say to the script that "users" is not the table name, and type
"user" in the script for correct coding generation. then, your model
is going to be called "user.php", instead of cakephp conventional name
"users.php".

I hope this can help you.

Regards.

On Jul 24, 1:50 am, Anibigi  wrote:
> Hi,
>
> I am using Bake to create models for my database tables.
> I have run into a little problem.
>
> I have 25 tables 
>
> I strated baking the models until for one of the database tables the
> bake started giving a name of it own to the model,file and class.
>
> For example ,the table in database is named :  'risk_manager'
>
> (It has association with other tables which i'm defining while baking)
>
> However the model for this turns up as a file called "risk.php" and
> the class name is called "risk" (but it is mapped to the correct
> table.)
>
> Why is this happening...?
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Problem with HBTM tables. (included image)

2009-07-23 Thread Carlos Suarez Fontalvo

pliz, if there is one here can help me, i'll apreciated a lot.

On Jul 22, 10:03 am, Carlos Suarez Fontalvo
 wrote:
> I have a problem when trying to identify the HBTM arguments for this
> relatioship.
> The table is this one:http://tinyurl.com/mwq9q6
> I know, that the table doen't follow cakephp conventions, but for this
> reason its because I cannot identify the HBTM parameters.
> The image above show 3 important tables. these are: TipoUsuario,
> TipoUsuarioModulo, Modulo.
>
> I wanna identify the HBTM association in TipoUsuario y Modulo.
> This is what i don't how to "configure" it in my models
>
> Here is the link:http://paste.ideaslabs.com/show/OADWeqUcbQ
>
> I cannot identify the jointable, foreignKey, associationForeignKey, in
> TipoUsuario and Modulo models.
>
> I also wanna know if my TipoUsuarioModulo model y right. here is the
> TipoUsuarioModulo model code.
>
> Here is the link:http://paste.ideaslabs.com/show/g8CtwdJU1V
>
> Greetings for any ideas that help me to solve this problem.
>
> my email is ing.carlos.s at gmail dot com
--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Problem with HBTM tables. (included image)

2009-07-22 Thread Carlos Suarez Fontalvo

I have a problem when trying to identify the HBTM arguments for this
relatioship.
The table is this one:
http://tinyurl.com/mwq9q6
I know, that the table doen't follow cakephp conventions, but for this
reason its because I cannot identify the HBTM parameters.
The image above show 3 important tables. these are: TipoUsuario,
TipoUsuarioModulo, Modulo.

I wanna identify the HBTM association in TipoUsuario y Modulo.
This is what i don't how to "configure" it in my models

Here is the link: http://paste.ideaslabs.com/show/OADWeqUcbQ

I cannot identify the jointable, foreignKey, associationForeignKey, in
TipoUsuario and Modulo models.

I also wanna know if my TipoUsuarioModulo model y right. here is the
TipoUsuarioModulo model code.

Here is the link: http://paste.ideaslabs.com/show/g8CtwdJU1V


Greetings for any ideas that help me to solve this problem.

my email is ing.carlos.s at gmail dot com

--~--~-~--~~~---~--~~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---