[CDBI] Re: ChildOf
[prev]
[thread]
[next]
[Date index for 2005/09/09]
> CDBI::Server->child_of ( cluster => CDBI::Cluster => 'cluster_id');
>
> OR (you could be child of multiple clusters:)
>
> CDBI::Server->child_of ( maintenance_cluster => CDBI::Cluster =>
> 'mcluster_id');
> CDBI::Server->child_of ( web_cluster => CDBI::Cluster => 'wcluster_id');
> --------------------
> Like might_have, child_of creates the accessor (.e.g web_cluster) which will
> return a parent object.
This sounds useful, but I don't quite understand from your description how it
differs from a has_a relationship from the child to the parent (other than it
allows you to specify the accessor name for the parent). What am I missing?
I implement similar parent/child relationships like so:
Parent->columns('Primary' => qw/parent_id/);
Parent->has_many(children => Child);
Child->columns('Primary' => qw/child_id/);
Child->columns('Others => qw/parent_id/);
Child->has_a(parent_id => Parent);
How does ChildOf simplify or improve on this?
Thanks,
Ed
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
[CDBI] Re: ChildOf
Edward J. Sabol 23:52 on 09 Sep 2005
|