Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
HTML::FormHandler::TraUserrContributedMPerFormHandler::TraitFor::DBICFields(3)

NAME
       HTML::FormHandler::TraitFor::DBICFields - role to get fields from
       DBIx::Class result source

VERSION
       version 0.19

SYNOPSIS
       This is a role to pull fields from a DBIx::Class	result source.
       Requires	existence of a 'source'	attribute.

       This feature is new. It doesn't handle relationships yet, and the
       interfaces are still subject to change.

	 my $form = HTML::FormHandler::Model::DBIC->new_with_traits(
	     traits => ['HTML::FormHandler::TraitFor::DBICFields'],
	     item => $book
	 );

	   for my $rel(	$source->relationships ) {
	       next if grep { $_ eq $rel } @exclude;
	       next if grep { $_->[1] eq $rel }	$self->m2m_for_class($class);
	       my $info	= $source->relationship_info($rel);
	       push @exclude, get_self_cols( $info->{cond} );
	       my $rel_class = _strip_class( $info->{class} );
	       my $elem_conf;
	       if ( ! (	$info->{attrs}{accessor} eq 'multi' ) )	{
		   push	@fields, "has_field '$rel' => (	type =>	'Select', );"
	       }
	       elsif( $level < 1 ) {
		   my @new_exclude = get_foreign_cols (	$info->{cond} );
		   my $config =	$self->get_fields ( $rel_class,	1, );
		   my $target_class = $rel_class;
		   $target_class = $self->class_prefix . '::' .	$rel_class if $self->class_prefix;
		   $config->{class} = $target_class;
		   $config->{name} = $rel;
       #	   $self->set_field_class_data(	$target_class => $config ) if !$self->exists_field_class( $target_class	);
		   my $field_def = '';
       #	   if( defined $self->style && $self->style eq 'single'	){
       #	       $field_def .= '#	';
       #	   }
		   $field_def .= "has_field '$rel' => (	type =>	'+${target_class}Field', );";
		   push	@fields, $field_def;
	       }
	   }

AUTHOR
       FormHandler Contributors	- see HTML::FormHandler

COPYRIGHT AND LICENSE
       This software is	copyright (c) 2012 by Gerda Shank.

       This is free software; you can redistribute it and/or modify it under
       the same	terms as the Perl 5 programming	language system	itself.

perl v5.24.1			  20HTML::FormHandler::TraitFor::DBICFields(3)

NAME | VERSION | SYNOPSIS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=HTML::FormHandler::TraitFor::DBICFields&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help