Feature #1634

Allow omitting the @reference annotation for object properties

Added by Robert Lemke almost 7 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2008-10-02
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:-
PHP Version: Complexity:
Has patch:

Description

Currently all properties of type object which are supposed to be persisted need to be annotated as a reference:

    /**
     * Content attached to this structure node
     *
     * @var F3::TYPO3::Domain::Model::ContentInterface
     * @reference
     */
    protected $content;

I'd say that this is counter-intuitive for most developers. Ideally the persistence framework would recognize object properties and assume that they are references:

    /**
     * Content attached to this structure node
     *
     * @var F3::TYPO3::Domain::Model::ContentInterface
     */
    protected $content;

If the object should not be persisted, @transient is used (as usual).

History

#1 Updated by Karsten Dambekalns almost 7 years ago

Check: maybe we have to keep @reference because FLOW3 cannot know the type if the array is empty.

#2 Updated by Karsten Dambekalns over 6 years ago

From the CR point of view: If the array is empty it's empty. No need to know the types of the stuff that might be in there. And if there is an object in there, we must treat it like a reference, since objects cannot be store directly in a CR.

The only thing that changes now is: we cannot fetch all reference properties by tag, but instead loop over all properties of a class, checking or the need to process them as reference holders.

#3 Updated by Karsten Dambekalns over 6 years ago

  • Status changed from New to Accepted
  • % Done changed from 0 to 80

#4 Updated by Karsten Dambekalns over 6 years ago

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

Applied in changeset r1500.

Also available in: Atom PDF