VersionPress\Utils\IdUtil::newId PHP Méthode

newId() public static méthode

See wiki docs for discussion about the chosen ID algorightm and format.
public static newId ( ) : string
Résultat string
    public static function newId()
    {
        return self::newUuid('%04x%04x%04x%04x%04x%04x%04x%04x');
    }

Usage Example

 public function identifyEntity($entityName, $data, $id)
 {
     if ($this->schemaInfo->getEntityInfo($entityName)->usesGeneratedVpids) {
         $data['vp_id'] = IdUtil::newId();
         $this->saveId($entityName, $id, $data['vp_id']);
     }
     $data[$this->schemaInfo->getEntityInfo($entityName)->idColumnName] = $id;
     $data = $this->fillId($entityName, $data, $id);
     return $data;
 }
All Usage Examples Of VersionPress\Utils\IdUtil::newId