Re: Constraining a Class
[prev]
[thread]
[next]
[Date index for 2005/07/12]
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
|
|
Re: Constraining a Class
Tony Bowden 07:42 on 12 Jul 2005
|