本文整理汇总了PHP中Relationship::setStartNode方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::setStartNode方法的具体用法?PHP Relationship::setStartNode怎么用?PHP Relationship::setStartNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::setStartNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
$this->client = $this->getMock('Everyman\\Neo4j\\Client', array(), array(), '', false);
$this->path = new Path($this->client);
$rel = new Relationship($this->client);
$rel->setStartNode(new Node($this->client));
$rel->setEndNode(new Node($this->client));
$this->path->appendRelationship($rel);
$this->rels[0] = $rel;
$rel = new Relationship($this->client);
$rel->setStartNode(new Node($this->client));
$rel->setEndNode(new Node($this->client));
$this->path->appendRelationship($rel);
$this->rels[1] = $rel;
$node = new Node($this->client);
$this->path->appendNode($node);
$this->nodes[0] = $node;
$node = new Node($this->client);
$this->path->appendNode($node);
$this->nodes[1] = $node;
$node = new Node($this->client);
$this->path->appendNode($node);
$this->nodes[2] = $node;
$node = new Node($this->client);
$this->path->appendNode($node);
$this->nodes[3] = $node;
}
示例2: testSaveRelationship_Create_NoType_ThrowsException
public function testSaveRelationship_Create_NoType_ThrowsException()
{
$start = new Node($this->client);
$start->setId(123);
$end = new Node($this->client);
$end->setId(456);
$rel = new Relationship($this->client);
$rel->setStartNode($start);
$rel->setEndNode($end);
$this->setExpectedException('Everyman\\Neo4j\\Exception');
$this->client->saveRelationship($rel);
}
示例3: populateRelationship
/**
* Fill a relationship with data
*
* @param Relationship $rel
* @param array $data
* @return Relationship
*/
public function populateRelationship(Relationship $rel, $data)
{
$rel->useLazyLoad(false);
$rel->setProperties($data['data']);
$rel->setType($data['type']);
$rel->setStartNode($this->getNodeFromUri($data['start']));
$rel->setEndNode($this->getNodeFromUri($data['end']));
return $rel;
}