Re: [CDBI] Adding metadata to objects
[prev]
[thread]
[next]
[Date index for 2005/09/27]
The latest Class::DBI made a change to has_many where you can list
restraints at compile time. I think the syntax is like this:
CD->has_many('rock_tracks' =3D> Track, {constraint =3D> [ genre =3D> 'roc=
k' ]} );
The constraint is put in the meta_info and when you say
CD->rock_tracks you only get back ones with genre rock.
However since you don't know your constraint until run time, perhaps
you could use the limiting form of the has_many accessor:
CD->has_many(tracks =3D> Track);
my $rock_tracks =3D CD->tracks(genre=3D> 'rock');
I don't know if there is a public interface to set meta info. I'd
like to know.
cheers
--
pjs
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi