Bug #29979

PersistenceManager::getIdentifierByObject() only returns first Id property

Added by Bastian Waidelich over 1 year ago. Updated about 1 year ago.

Status:Needs Feedback Start date:2011-09-18
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:Persistence
Target version:-
PHP Version: Complexity:
Has patch:No FLOW3 version affected:FLOW3 1.0.0
Votes: 1 (View)

Description

The doc comment for \TYPO3\FLOW3\Persistence\PersistenceManagerInterface::getIdentifierByObject() says, that the return type is "mixed".
Usually that is the UUID of the object (string).
If the object has an @Id property, that will be returned insted.
In case the object has multiple @Id properties, only the first of those is returned.

Example:
Mode:

class ObjectPathMapping {

    /**
     * @var string
     * @Id
     */
    protected $objectType;

    /**
     * @var string
     * @Id
     */
    protected $uriPattern;

    /**
     * @var string
     * @Id
     */
    protected $pathSegment;
[...]
}

Now, only the value of $objectType would be returned. Instead I'd expect an array that contains the Id properties - or a serialized representation!?

History

Updated by Bastian Waidelich over 1 year ago

BTW: It would make our life easier, if the return type would be fixed (e.g. string)

Updated by Karsten Dambekalns over 1 year ago

  • FLOW3 version affected set to FLOW3 1.0.0

Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9650

Updated by Robert Lemke about 1 year ago

  • Status changed from Under Review to Needs Feedback
  • Has patch set to No

Also available in: Atom PDF