Feature #2621

Support SPLObjectStorage as container for references to other persisted objects

Added by Robert Lemke over 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-02-12
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 1
PHP Version: Complexity:
Has patch:

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
Added by Karsten Dambekalns over 6 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 6 years ago

  • % Done changed from 0 to 50

#2 Updated by Karsten Dambekalns over 6 years ago

  • % Done changed from 50 to 70

#3 Updated by Karsten Dambekalns over 6 years ago

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

Applied in changeset r1972.

Also available in: Atom PDF