}
}
+=head2 related_meta
+
+ $class->related_meta($col);
+
+Given a column associated with a relationship it will return the relatation
+ship type and the meta info for the relationship on the column.
+
+=cut
+
+sub related_meta {
+ my ($self,$r, $accssr) = @_;
+ $self->_croak("You forgot to put the place holder for 'r' or forgot the accssr parameter") unless $accssr;
+ my $class_meta = $self->meta_info;
+ if (my ($rel_type) = grep { defined $class_meta->{$_}->{$accssr} }
+ keys %$class_meta)
+ { return $rel_type, $class_meta->{$rel_type}->{$accssr} };
+}
+
+
=head2 isa_class
-Returns class of a column inherited by is_a, assumes something can be more than one thing (have * is_a rels)
+Returns class of a column inherited by is_a.
=cut
+# Maybe put this in IsA?
sub isa_class {
my ($class, $col) = @_;
$class->_croak( "Need a column for isa_class." ) unless $col;
my $isaclass;
- # class col is first found in is returned
my $isa = $class->meta_info("is_a") || {};
foreach ( keys %$isa ) {
$isaclass = $isa->{$_}->foreign_class;
Returns hash ref of classes for accessors.
This is an attempt at a more efficient method than calling "related_class()"
-a bunch of times when you need it for many relations.
+a bunch of times when you need it for many relations.
+It may be good to call at startup and store in a global config.
=cut