Mercurial > pub > Impl
diff Lib/IMPL/SQL/Schema/Column.pm @ 168:6148f89bb7bf
IMPL::SQL::Schema::Traits::Diff alfa version
IMPL::lang added hash traits
author | sourcer |
---|---|
date | Mon, 16 May 2011 04:30:38 +0400 |
parents | 1f7a6d762394 |
children | 4d0e1962161c |
line wrap: on
line diff
--- a/Lib/IMPL/SQL/Schema/Column.pm Thu May 12 08:57:19 2011 +0400 +++ b/Lib/IMPL/SQL/Schema/Column.pm Mon May 16 04:30:38 2011 +0400 @@ -2,7 +2,7 @@ package IMPL::SQL::Schema::Column; use parent qw(IMPL::Object IMPL::Object::Autofill); -use IMPL::lang qw( :DEFAULT :compare :declare :constants ); +use IMPL::lang qw( :DEFAULT :compare :declare :constants :hash ); use IMPL::Class::Property::Direct; use IMPL::Exception(); @@ -39,4 +39,32 @@ ); } +sub SetType { + my ($this,$newType) = @_; + + $this->{$type} = $newType; +} + +sub SetDefaultValue { + my ($this,$value) = @_; + + $this->{$defaultValue} = $value; +} + +sub SetNullable { + my ($this, $value) = @_; + + $this->{$isNullable} = $value; +} + +sub SetOptions { + my ($this,$diff) = @_; + + return unless ref $diff eq 'HASH'; + + $this->tag({}) unless $this->tag; + + hashApply($this->tag,$diff); +} + 1;