Re: Constraining a Class

[prev] [thread] [next] [Date index for 2005/07/12]

From: Tony Bowden
Subject: Re: Constraining a Class
Date: 07:42 on 12 Jul 2005
On Tue, Jul 12, 2005 at 11:08:03AM +1000, Rick Measham wrote:
> I have a table 'Company' in my database. This table holds all manner of 
> companies: Customers, Potential Customers, Previous Customers, Suppliers 
> etc. There's an enum field that tells me which sort of company each row 
> represents.

OK.
 
> I'd like to be able to create My::Data::Customer, 
> My::Data::PotentialCustomer etc., representing each of these types of 
> record in the table.

This isn't really how Class::DBI works. Each class represents a table. 

However, have a look at Class::DBI::Relationship::HasVariant (from
CPAN). I haven't used it, so I can't speak for it, but I believe it does
something along these lines.

Tony

Constraining a Class
Rick Measham 01:08 on 12 Jul 2005

Re: Constraining a Class
Tony Bowden 07:42 on 12 Jul 2005

Re: Constraining a Class
Aaron Trevena 16:56 on 12 Jul 2005

Re: Constraining a Class
Todd Lorenz 17:14 on 12 Jul 2005

Generated at 16:35 on 28 Jul 2005 by mariachi v0.52