Hi all,

inside the identity map, related objects are stored in an array, indexed
by their ID, to be able to access them internally. ezcPersistentSession
returns related object arrays as they come from the database, i.e. by an
ascending counter.

Examples:

ezcPersistentSession->getRelatedObjects( ... ):

array(
    0 => SomeObject( 1 ),
    1 => SomeObject( 5 ),
    2 => SomeObject( 3 )
);

ezcPersistentIdentitySession->getRelatedObjects( ... ):

array(
    1 => SomeObject( 1 ),
    5 => SomeObject( 5 ),
    3 => SomeObject( 3 )
);

Therefore, the array returned by
ezcPersistentSession->getRelatedObjecst() and
ezcPersistentIdentitySession->getRelatedObjects() currently differ. Do
we see this as a regression (since instances of these classes should be
seamlessly interchangeable)? If yes, which place should be fixed?

I'm in favor of changing the indexing in ezcPersistentSession to the
behaviour of ezcPersistentIdentitySession. So far, the array returned by
ezcPersistentSession can only be used to iterate over all related
objects, but not to access single objects by ID. Iteration would also
work as before, so we don't break BC here. On the other hand it would
mean a little time overhead in re-indexing the array during fetch.

What would you say?

Regards,
Toby
-- 
Mit freundlichen Grüßen / Med vennlig hilsen / With kind regards

Tobias Schlitt (GPG: 0xC462BC14) eZ Components Developer

[email protected] | eZ Systems AS | ez.no
-- 
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components

Reply via email to