Bug #29979

PersistenceManager::getIdentifierByObject() only returns first Id property

Added by Bastian Waidelich about 10 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Persistence
Target version:
-
Start date:
2011-09-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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!?

Also available in: Atom PDF