Feature #2621

Support SPLObjectStorage as container for references to other persisted objects

Added by Robert Lemke over 10 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2009-02-12
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

Currently references to other objects must be stored in an array or as a single property:

class Invoice {

   /**
    * @var array
    */
   protected $invoiceDetails = array();

   /**
    * @var Customer
    */
   protected $customer;
}

But in many cases it makes sense to store objects in an SPLObjectStorage:

class Blog {

   /**
    * @var \SPLObjectStorage
    */
   protected $posts;
}

By using the SPLObjectStorage we can assure that no post can be added twice
to a blog.

The Persistence Manager should therefore support SPLObjectStorages

Associated revisions

Revision 492958c6 (diff)
Added by Karsten Dambekalns over 10 years ago

FLOW3, TYPO3CR:
  • persistence now supports properties of type \SplObjectStorage, fixes #2621
  • general cleanup in persistence backend and data mapper
  • thorough rewrite of the unit tests for persistence backend and data mapper

History

#1 Updated by Karsten Dambekalns over 10 years ago

  • % Done changed from 0 to 50

#2 Updated by Karsten Dambekalns over 10 years ago

  • % Done changed from 50 to 70

#3 Updated by Karsten Dambekalns over 10 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 70 to 100

Applied in changeset r1972.

Also available in: Atom PDF