CatalystX::CRUD::YUI::Serializer - flatten CatalystX::CRUD::Object instances
use CatalystX::CRUD::YUI::Serializer; my $serializer = CatalystX::CRUD::YUI::Serializer->new( datetime_format => '%Y-%m-%d %H:%M:%S', html_escape => 1, ); my $hashref = $serializer->serialize_object( object => $my_object, col_names => [qw( id name email )], cat_context => $c, rel_info => $rel_info, );
CatalystX::CRUD::YUI::Serializer turns objects into hashrefs, typically for rendering as JSON.
Only new or overridden method are documented here.
Instantiate new Serializer.
Set strftime-style DateTime format string. Default is '%Y-%m-%d %H:%M:%S'. Used in serialize_object().
serialize_object() will escape all special HTML characters by default. Set html_escape to false (0) if turn that feature off.
Serialize a CatalystX::CRUD::Object instance, or an object that acts like one. params should be a hash or hashref of key/value pairs. The "object" key pair and "col_names" key pair are required.
Returns a hashref of key/value pairs representing the object.
Returns array ref of hash refs as passed through serialize_object().
Please report any bugs or feature requests to
firstname.lastname@example.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
The Minnesota Supercomputing Institute
http://www.msi.umn.edu/ sponsored the development of this software.
Copyright 2008 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.