本文整理汇总了PHP中Node::setProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Node::setProperties方法的具体用法?PHP Node::setProperties怎么用?PHP Node::setProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Node
的用法示例。
在下文中一共展示了Node::setProperties方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCommitBatch_CreateNode_Success_ReturnsTrue
public function testCommitBatch_CreateNode_Success_ReturnsTrue()
{
$node = new Node($this->client);
$node->setProperties(array('foo' => 'bar', 'baz' => 'qux'));
$request = array(array('id' => 0, 'method' => 'POST', 'to' => '/node', 'body' => array('foo' => 'bar', 'baz' => 'qux')));
$return = array('code' => 200, 'data' => array(array('id' => 0, 'location' => 'http://foo:1234/db/data/node/123')));
$this->batch->save($node);
$this->setupTransportExpectation($request, $this->returnValue($return));
$result = $this->client->commitBatch($this->batch);
$this->assertTrue($result);
$this->assertEquals(123, $node->getId());
$this->assertSame($node, $this->client->getEntityCache()->getCachedEntity(123, 'node'));
}
示例2: testSaveNode_Create_TransportError_ThrowsException
public function testSaveNode_Create_TransportError_ThrowsException()
{
$properties = array('foo' => 'bar', 'baz' => 'qux');
$node = new Node($this->client);
$node->setProperties($properties);
$this->transport->expects($this->once())->method('post')->with('/node', $properties)->will($this->returnValue(array('code' => 400)));
$this->setExpectedException('Everyman\\Neo4j\\Exception');
$this->client->saveNode($node);
}
示例3: loadNode
/**
* Load the given node with data from the server
*
* @param Node $node
* @return boolean
*/
public function loadNode(Node $node)
{
$cached = $this->getEntityCache()->getCachedEntity($node->getId(), 'node');
if ($cached) {
$node->setProperties($cached->getProperties());
return true;
}
return $this->runCommand(new Command\GetNode($this, $node));
}
示例4: inflateFromResponse
public static function inflateFromResponse($neo_db, $response)
{
$node = new Node($neo_db);
$node->_is_new = FALSE;
$node->_id = end(explode("/", $response['self']));
$node->setProperties($response['data']);
return $node;
}
示例5: populateNode
/**
* Fill a node with data
*
* @param Node $node
* @param array $data
* @return Node
*/
public function populateNode(Node $node, $data)
{
$node->useLazyLoad(false);
$node->setProperties($data['data']);
return $node;
}
示例6: inflateFromResponse
/**
* @static
* @param Database $db
* @param array $response
* @return Node
*/
public static function inflateFromResponse($db, $response)
{
$self_path = explode("/", $response['self']);
$node = new Node($db);
$node->_is_new = false;
$node->_id = end($self_path);
$node->setProperties($response['data']);
return $node;
}