orientechnologies/PhpOrient

int is returned as string

Closed this issue · 1 comments

dev-master:today
Hi, I am inserting an int and it is returned as a string. Here is my schema setup (it is integer obviously and saved): http://i.imgur.com/vc93Yq6.png

$data = ["IsOfTypeCount" => 10];
var_dump($data);
$transaction = $db->getTransactionStatement();
$transaction = $transaction->begin();
$record =  (new Record())
            ->setOData( $data )
            ->setOClass( "Entity" )
            ->setRid( new ID() );

$createCommand = $db->recordCreate($record);
$transaction->attach( $createCommand );
$transaction->commit();
$record = $db->query("select from Entity where @rid ='".$record->getRid()."'")[0];
$dataNew = $record->getOData();
 var_dump($dataNew);
//results:
array(1) {
  ["IsOfTypeCount"]=>
  int(10)
}
array(1) {
  ["IsOfTypeCount"]=>
  string(2) "10"
}

Thanks
Michail

Moved on Ostico#14