Dave Rolsky wrote:

On Tue, 21 Mar 2006, Herbert Liechti wrote:

I'm currently implementing a ressource reservation system and I'm
using the DateTime libs for this purpose. My main problem is
that im generating a set of Datetimes from ressource objects
(ie a month view) which are holding the information about
the ressource and its corresponding reservations.

The resulting set has no longer an assiociation to the original
ressource object. For reporting purposes it would be nice to
have an association back to the original object. ie.

my $dt = DateTime->new ( year => xxx, month => and so on....
refers_to => $objectreference);

and later

while iterating my set {
my $resObj = dt->getReferer();
}

any idea how to do that?


You could subclass DateTime.pm and just add your field. The DateTime::Set modules should work fine with this.

Dave

Thanks for your response. As far as I see there is no easy way to subclass
DateTime::Span and DateTime::SpanSet.  When I subclass DateTime::Span
I can't use DateTime::SpanSet anymore. I try to explain my problem with
the following schema:

ressource                             address
    |                                    |
    +-----------reservation--------------+
                     |
                     | calculating spans from various reservations
                     |
                  1 SpanSet for a specified time (i.e. 1 month)
                     |
                     | iterating (lost the context to reservation xy)
                  report

A reservation contains the necessary informations for creating DateTime::Event::Recurrence
objects
Any idea? Thank you and best regards

Herbie

Reply via email to