cake-php@googlegroups.com
[Top] [All Lists]

Re: How to validate HABTM extra fields

Subject: Re: How to validate HABTM extra fields
From: Jeremy Burns
Date: Fri, 16 Apr 2010 05:37:34 +0100
Does this help?

http://teknoid.wordpress.com/2008/09/24/saving-extra-fields-in-the-join-table-for-habtm-models/

Jeremy Burns
jeremyburns@xxxxxx
On 15 Apr 2010, at 20:46, peej wrote:

> I need to validate extra fields in a HABTM join table.
> 
> Ticket HABTM Shirt with the join table shirts_tickets
> 
> This is the shirts_tickets join table with extra fields:
> 
> CREATE TABLE `shirts_tickets` (
>  `shirt_id` int(11) DEFAULT NULL,
>  `ticket_id` int(11) DEFAULT NULL,
>  `size` varchar(20) DEFAULT NULL,
>  `qty` int(11) DEFAULT NULL
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1
> 
> Everything saves fine but I need to validate the data being saved in
> the extra fields. Basically, if someone adds a shirt to their ticket I
> need to make sure they also enter a size. I've searched everywhere and
> have been unable to figure out how to do this.
> 
> 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@xxxxxxxxxxxxxxxx
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>