dov11020 2014-02-18 11:22
浏览 30

在Neo4j中调用makeLabel for PHP失败了

Creating nodes works fine, but when I try to add labels I run into the following problem.

PHP Fatal error: Call to undefined method Everyman\Neo4j\Client::makeLabel() in /elixir/apps/home/bin/elixir_classes/class.StorageController.php on line 208

What am I doing wrong here?

Thanks,

-Edwin

This is the snippet of the relevant code

<?php

use Everyman\Neo4j\Client,
    Everyman\Neo4j\Transport,
    Everyman\Neo4j\Node,
    Everyman\Neo4j\Relationship;

.
.

$neo4jclient = new Client(new Transport('durq2idb10-tst.corp.xyz.com', 7474));

// Create nodes

$controller = new Node($neo4jclient);
$controller->setProperty('serialnumber', "$this->serialnumber")->save();
$controller->setProperty('system_id', "$this->system_id")->save();
$controller->setProperty('hostname', "$this->hostname")->save();

$controller_label=$neo4jclient->makeLabel('Storage Controller');
$controller->addLabels($controller_label)->save();
  • 写回答

1条回答 默认 最新

  • douyuliu9527 2014-02-18 14:12
    关注

    You seem to be using an older version of neo4jphp. Please install the lastest version using Composer, as described here: https://github.com/jadell/neo4jphp/wiki/Getting-started

    You will need to change the Client instantiation. Change the line to

    $neo4jclient = new Client('durq2idb10-tst.corp.xyz.com', 7474);
    

    If you need to customize the Transport (it does not look like you are doing that, but just in case) you can do new Transport\Curl($host, $port) or new Transport\Stream($host, port).

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么