[FLOW3-general] Accessing an object's entityUUID

Robert Lemke robert at typo3.org
Wed Jan 6 13:04:55 CET 2010


Hi Zach,

Am 02.01.2010 um 18:10 schrieb Zachary Davis, Cast Iron Coding LLC:

> I have an object that I want to edit via an extJS form. The form sends an asynchronous request to a controller, which returns a JSON representation of the object. Each object has a "number" property in this case, that uniquely identifies it -- but it seems to me that I should request the object by it's entityUUID. Is this the wrong approach? It looks like I can write a get method on the object that returns its FLOW3_Persistence_Entity_UUID. Are there any compelling reasons why I should avoid using this identifier in my application?

in theory you're right, you _could_ use that property. However it is not part of the public API and the property could vanish or change without further notice.

The right / official way to access the identifier of an object (uuid of an entity) is to ask the Persistence Manager:

$uuid = $persistenceManager->getBackend()->getIdentifierByObject($theEntity);

But be warned: This is one of the few API methods which will change in FLOW3 1.0.0 alpha 7. In the next version the getIdentifierByObject() method is provided directly by the Persistence Manager, not its backend.

Cheers,
robert



More information about the FLOW3-general mailing list