Changeset 944 for LATMOS-Accounts
- Timestamp:
- 04/26/12 18:54:04 (12 years ago)
- Location:
- LATMOS-Accounts/lib/LATMOS/Accounts/Bases
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql.pm
r943 r944 321 321 } 322 322 323 sub is_registered_attribute { 324 my ($self, $otype, $attribute) = @_; 325 my $pclass = $self->_load_obj_class($otype) or return; 326 $pclass->is_registered_attribute($self, $attribute); 327 } 328 323 329 sub get_attribute_comment { 324 330 my ($self, $otype, $attribute) = @_; -
LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm
r861 r944 619 619 my ($class, $base, $attribute, $comment) = @_; 620 620 621 $ base->attribute($class->type, $attribute) and do {621 $class->is_registered_attribute($base, $attribute) and do { 622 622 $base->log(LA_ERR, "The attribute $attribute already exists"); 623 623 return; … … 630 630 ); 631 631 my $res = $sth->execute($attribute, $comment); 632 } 633 634 sub is_registered_attribute { 635 my ($class, $base, $attribute) = @_; 636 637 my $sth = $base->db->prepare( 638 sprintf(q{ 639 select 1 from %s where canonical = ? 640 }, $class->attributes_table 641 ) 642 ); 643 $sth->execute($attribute); 644 my $res = $sth->fetchrow_hashref; 645 return $res ? 1 : 0; 632 646 } 633 647
Note: See TracChangeset
for help on using the changeset viewer.