Warning: You are browsing the documentation from version 4 to 10 of Pimcore. Please visit https://pimcore.com/docs/platform/ for the latest versions of Pimcore.
Version: Edit on GitHub

UUID Support

Pimcore provides a toolkit for UUID-support. To activate the UUID-support, an instance identifier has to be set manually in the config.yaml file.

general:
   [...]
  instance_identifier: 'your_unique_instance_identifier'

Once set, Pimcore automatically creates an UUID for each newly created document, asset and object. With the class Tool\UUID you have access to the UUIDs as follows:

use Pimcore\Model\Tool;
  
//get UUID for given element (document, asset, object)
$uuid = Tool\UUID::getByItem($document);
 
//get element for given UUID
$document = Tool\UUID::getByUuid($uuid);
 
//create and save uuid for given element
$uuid = Tool\UUID::create($document);