【发布时间】:2017-01-25 06:55:12
【问题描述】:
我是 neo4j 和 neo4j-php-clien 的新手,并遵循基本用法中的教程。
这就是我所拥有的:
$result = $client->run("MATCH (n:Person) RETURN n");
echo var_dump ($result->getRecords());
这是输出:
object(GraphAware\Neo4j\Client\Formatter\RecordView)#31 (3) { ["keys":protected]=> array(1) { [0]=> string(1) "n" } [" values":protected]=> array(1) { [0]=> object(GraphAware\Neo4j\Client\Formatter\Type\Node)#40 (3) { ["id":protected]=> int(187) ["labels":protected]=> array(1) { [0]=> string(8) "X2Person" } ["properties":protected]=> array(2) { ["name"]=> string( 4) "Ales" ["age"]=> int(34) } } } ["keyToIndexMap":"GraphAware\Neo4j\Client\Formatter\RecordView":private]=> array(1) { ["n"] => int(0) } }
如何访问记录的受保护和私有字段?
【问题讨论】:
-
我已经试过 $record = $result->getRecord(); $record->value('年龄');除了 $record->values() 之外的方法都不起作用。
标签: php neo4j graphaware