On 5/2/07, Jonathan Vanasco <[EMAIL PROTECTED]> wrote:
> ie: instead of declaring this :
>
>         columns=[
>                 'email_address' => { type="varchar" , length=64 }
>         ]
>
> you would declare:
>
>         columns=[
>                 'email_address' => { class="Email" }
>         ]
>
> rose would then look at the Email class and derive the correct setup
> information -- ie a varchar column of x size
> whenever get/set methods are used, they would instantiate / access an
> Email object.  the Email object would use overload to display as a
> string and seem to function normally -- but contains a validity check
> whenever its value is set , and will die/ raise an error if you try
> to set an invalid email address.

You can do this already, more or less, by making your own
My::EmailColumn class based on Rose::DB::Object::Metadata::Column,
then mapping that class to a type name using
meta->column_type_class(email => 'My::EmailColumn').  Then, in your
class setup, you'd do:

    columns => [ email_address => { type => 'email' }, ... ]

-John

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to