Mercurial > pub > Impl
diff Lib/IMPL/SQL/Schema/Constraint/PrimaryKey.pm @ 165:76515373dac0
Added Class::Template,
Rewritten SQL::Schema
'use parent' directive instead of 'use base'
author | wizard |
---|---|
date | Sat, 23 Apr 2011 23:06:48 +0400 |
parents | 16ada169ca75 |
children | 6148f89bb7bf |
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema/Constraint/PrimaryKey.pm Mon Mar 28 01:36:24 2011 +0400 +++ b/Lib/IMPL/SQL/Schema/Constraint/PrimaryKey.pm Sat Apr 23 23:06:48 2011 +0400 @@ -1,42 +1,41 @@ package IMPL::SQL::Schema::Constraint::PrimaryKey; use strict; -use base qw(IMPL::SQL::Schema::Constraint::Index); +use parent qw(IMPL::SQL::Schema::Constraint::Index); use IMPL::Class::Property; use IMPL::Class::Property::Direct; __PACKAGE__->PassThroughArgs; BEGIN { - public _direct property ConnectedFK => prop_get; + public _direct property connectedFK => prop_get; } sub CTOR { my ($this,%args) = @_; - $this->SUPER::CTOR(%args); - - $this->{$ConnectedFK} = {}; + $this->{$connectedFK} = {}; } sub ConnectFK { my ($this,$FK) = @_; UNIVERSAL::isa($FK,'IMPL::SQL::Schema::Constraint::ForeignKey') or die new Exception('Aprimary key could be connected only to a foreign key'); - not exists $this->{$ConnectedFK}->{$FK->UniqName} or die new Exception('This primary key already conneted with the specified foreing key',$FK->Name,$FK->Table->Name); + not exists $this->{$connectedFK}->{$FK->uniqName} or die new Exception('This primary key already conneted with the specified foreing key',$FK->name,$FK->table->name); - $this->{$ConnectedFK}->{$FK->UniqName} = $FK; + $this->{$connectedFK}->{$FK->uniqName} = $FK; } sub DisconnectFK { my ($this,$FK) = @_; - delete $this->{$ConnectedFK}->{$FK->UniqName}; + delete $this->{$connectedFK}->{$FK->uniqName}; } sub Dispose { my ($this) = @_; - delete $this->{$ConnectedFK}; + delete $this->{$connectedFK}; + $this->SUPER::Dispose; }