Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Notice for transactions using README script #36

Closed electricjones closed 9 years ago

electricjones commented 9 years ago

When using the transaction script from the README, I get a php notice:

Notice: Trying to get property of non-object. PhpOrient, line 351

What's happening is that when recordCreate() is called without adding an ID to the mix, it is trying to pull the cluster from a non-existent ID object. Should be simple to fix with an isset() check, unless it is indicative of a larger problem.

Note that when I set the Rid manually:

$rec2Create = ['oClass' => 'V', 'oData' => ['alloggio' => 'albergo']];
$rec = Record::fromConfig($rec2Create);
$rec->setRid(new ID());

it gets rid of the notice and everything seems to work fine, but this is not ideal.