[Rt-devel] How to use the Attributes table?

Todd Chapman rt at chaka.net
Thu Dec 16 09:42:58 EST 2004


Don't you need to associate the attribute with an ObjectId?

On Thu, Dec 16, 2004 at 10:12:41AM -0500, Stephen Turner wrote:
> At Tuesday 12/14/2004 03:15 PM, Kumar, Vasanth wrote:
> >In the RT 3.2.2 release notes, it says:
> >
> >    * RT now provides an 'Attributes' table, which allows local
> >developers
> >      to easily extend all of RT's database tables with new read/write
> >      attributes without needing to modify RT's core schema
> >
> >But I can't seem to find any documentation on the Wiki site specifying
> >how to use this table.  Can someone please direct me to the appropriate
> >document?
> >
> >Thanks.
> 
> An example - I've used attributes to store additional user preferences:
> 
> my $attr = new RT::Attribute($session{'CurrentUser'});
> my @results = $attr->Create (Name => $Name,           #   Name of the 
> atribute
>                           Content => 
> $Value,                                  # Value you want to store
>                           ContentType => $ValueType,                 # I 
> used "String"
>                           Object => 
> $Object);                                  # Object you want to attach the 
> attribute to (in
>                                                                                              # my case a RT::User object)
> 
> To retrieve the attribute(s):
> 
> my @attrs = $Object->Attributes->Named($Name);
> 
> Where $Object is the user's RT::User object and $Name is the attribute name.
> 
> Steve 
> 
> _______________________________________________
> Rt-devel mailing list
> Rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel


More information about the Rt-devel mailing list