Re: How to avoid $class->new($value) with inflate

[prev] [thread] [next] [Date index for 2005/03/04]

From: Tony Bowden
Subject: Re: How to avoid $class->new($value) with inflate
Date: 11:08 on 04 Mar 2005
On Fri, Mar 04, 2005 at 10:19:41AM +1100, Frank Carnovale wrote:
> theory's great but it sure would be convenient to distinguish the two
> sometimes without having to say ref this and ref that to compare class
> names.

Ugh. You should never be comparing class names with 'ref'.

At very least you should be doing $class->isa('Class::DBI') or something
like that.

But if you really want a different relationship for has_a (-> other CDBI
object) vs has_noncdbi then you could just do something as simple as:


package Class::DBI::Relationship::HasNonCDBI;

use base 'Class::DBI::Relationship::HasA';

1;

and then in your application base:

__PACKAGE__->add_relationship_type(
	has_noncdbi => 'Class::DBI::Relationship::HasNonCDBI'
);

Then set your relationships up using whichever one you want.

Interrogating meta_info will then give you results for each group
individually.

Tony

(message missing)

How to avoid $class->new($value) with inflate
Matija Grabnar 12:18 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Charles Bailey 14:45 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
William McKee 15:17 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Matt S Trout 15:31 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
William McKee 15:40 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Charles Bailey 16:10 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Perrin Harkins 16:15 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
William McKee 16:50 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Perrin Harkins 17:00 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Charles Bailey 17:29 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Perrin Harkins 19:34 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
William Ross 17:10 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Michael Peters 17:08 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Perrin Harkins 17:12 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Perrin Harkins 19:49 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Carl Johnstone 09:56 on 04 Mar 2005

Re: How to avoid $class->new($value) with inflate
Frank Carnovale 23:19 on 03 Mar 2005

Re: How to avoid $class->new($value) with inflate
Tony Bowden 11:08 on 04 Mar 2005

Re: How to avoid $class->new($value) with inflate
Frank Carnovale 23:44 on 06 Mar 2005

Re: How to avoid $class->new($value) with inflate
Matt S Trout 17:34 on 03 Mar 2005

Generated at 20:12 on 07 Mar 2005 by mariachi v0.52