src/Charcoal/Property/IdProperty.php
public function autoGenerate()
    {
        $mode = $this->mode();

        if ($mode === self::MODE_UNIQID) {
            return uniqid();
        } elseif ($mode === self::MODE_UUID) {
            return $this->generateUuid();
        }

        return null;
    }
public function autoGenerate()
    {
        $mode = $this->mode();

        if ($mode === self::MODE_UNIQID) {
            return uniqid();
        } elseif ($mode === self::MODE_UUID) {
            return $this->generateUuid();
        }

        return null;
    }
public function autoGenerate ( ) { $ mode = $ this -> mode ( ) ; if ( $ mode === self :: MODE_UNIQID ) { return uniqid ( ) ; } elseif ( $ mode === self :: MODE_UUID ) { return $ this -> generateUuid ( ) ; } return null ; }
Auto-generate a value upon first save.

- self::MODE_AUTOINCREMENT
- null: The auto-generated value should be handled at the database driver level.
- self::MODE_CUSTOM
- null: Custom mode must be defined elsewhere.
- self::MODE_UNIQID
- A random 13-char `uniqid()` value.
- self::MODE_UUID
- A random RFC-4122 UUID value.

@throws DomainException If the mode does not have a value generator.
@return string|null
Auto - generate a value upon first save .