PhpOrient - setRid()

Setting Record ID's

When instatitating a Record() object in your application, you may need to set the specific Record ID on the object before syncing it with OrientDB. You can also partially define the record, by setting the Cluster ID for the cluste you want to create it in. Once the ID() instance is ready, you can pass it to this method to set the Record ID on the ojbect.

Syntax

$record->setRid(<id>)

<id> Defines the Record ID you want to set on the record. It is an instance of ID().

Example

When creating new records in your application, you can use this method to define the Record ID or the Cluster ID for the new record before syncing it with the database. In cases where you do this often, you may want to use a dedicated function to ensure consistency with common values.