first rev of new definition class
This commit is contained in:
parent
814bde6b93
commit
34182a39ee
3 changed files with 410 additions and 0 deletions
42
lib/WebGUI/Definition/Asset.pm
Normal file
42
lib/WebGUI/Definition/Asset.pm
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package WebGUI::Definition::Asset;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use 5.010;
|
||||
use base qw(WebGUI::Definition);
|
||||
|
||||
our $VERSION = '0.0.1';
|
||||
|
||||
sub import {
|
||||
my $class = shift;
|
||||
if (! @_) {
|
||||
return;
|
||||
}
|
||||
my $definition = (@_ == 1 && ref $_[0]) ? $_[0] : { @_ };
|
||||
if ( my $properties = $definition->{properties} ) {
|
||||
my $table = $definition->{table_name};
|
||||
for ( my $i = 1; $i < @{ $properties }; $i += 2) {
|
||||
$propeties->[$i]{table_name} = $table;
|
||||
}
|
||||
}
|
||||
my $next = $class->next::can;
|
||||
@_ = ($class, $definition);
|
||||
goto $next;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue