=cut
-has parent =>
-(
- is => 'ro',
- isa => JoinBuilder,
+has parent => (
+ is => 'ro',
+ isa => JoinBuilder,
predicate => 'has_parent',
- weak_ref => 1,
- trigger => sub { my ($self, $new) = @_; $new->add_child($self); },
+ weak_ref => 1,
+ trigger => sub { my ( $self, $new ) = @_; $new->add_child($self); },
);
=attribute_public children is: ro, isa: ArrayRef['Catalyst::Controller::DBIC::API::JoinBuilder'], traits => ['Array']
all_children => 'elements'
has_children => 'count'
- add_child => 'push'
+ add_child => 'push'
=cut
-has children =>
-(
- is => 'ro',
- isa => ArrayRef[JoinBuilder],
- traits => ['Array'],
+has children => (
+ is => 'ro',
+ isa => ArrayRef [JoinBuilder],
+ traits => ['Array'],
default => sub { [] },
- handles =>
- {
+ handles => {
all_children => 'elements',
has_children => 'count',
- add_child => 'push',
+ add_child => 'push',
}
);
=cut
-has joins =>
-(
- is => 'ro',
- isa => HashRef,
+has joins => (
+ is => 'ro',
+ isa => HashRef,
lazy_build => 1,
);
=cut
-has name =>
-(
- is => 'ro',
- isa => Str,
+has name => (
+ is => 'ro',
+ isa => Str,
required => 1,
);
=cut
-sub _build_joins
-{
+sub _build_joins {
my ($self) = @_;
my $parent;
- while(my $found = $self->parent)
- {
- if($found->has_parent)
- {
+ while ( my $found = $self->parent ) {
+ if ( $found->has_parent ) {
$self = $found;
next;
}
}
my $builder;
- $builder = sub
- {
+ $builder = sub {
my ($node) = @_;
my $foo = {};
- map { $foo->{$_->name} = $builder->($_) } $node->all_children;
+ map { $foo->{ $_->name } = $builder->($_) } $node->all_children;
return $foo;
};
- return $builder->($parent || $self);
+ return $builder->( $parent || $self );
}
=head1 DESCRIPTION