本文整理匯總了PHP中Node::useLazyLoad方法的典型用法代碼示例。如果您正苦於以下問題:PHP Node::useLazyLoad方法的具體用法?PHP Node::useLazyLoad怎麽用?PHP Node::useLazyLoad使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Node
的用法示例。
在下文中一共展示了Node::useLazyLoad方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCommitBatch_UpdateNode_Success_ReturnsTrue
public function testCommitBatch_UpdateNode_Success_ReturnsTrue()
{
$node = new Node($this->client);
$node->useLazyLoad(false)->setId(123)->setProperties(array('foo' => 'bar', 'baz' => 'qux'));
$request = array(array('id' => 0, 'method' => 'PUT', 'to' => '/node/123/properties', 'body' => array('foo' => 'bar', 'baz' => 'qux')));
$return = array('code' => 200, 'data' => array(array('id' => 0)));
$this->batch->save($node);
$this->setupTransportExpectation($request, $this->returnValue($return));
$result = $this->client->commitBatch($this->batch);
$this->assertTrue($result);
$this->assertSame($node, $this->client->getEntityCache()->getCachedEntity(123, 'node'));
}
示例2: testSaveNode_Update_TransportError_ThrowsException
public function testSaveNode_Update_TransportError_ThrowsException()
{
$properties = array('foo' => 'bar', 'baz' => 'qux');
$node = new Node($this->client);
$node->useLazyLoad(false)->setId(123)->setProperties($properties);
$this->transport->expects($this->once())->method('put')->with('/node/123/properties', $properties)->will($this->returnValue(array('code' => 400)));
$this->setExpectedException('Everyman\\Neo4j\\Exception');
$this->client->saveNode($node);
}
示例3: testSaveNode_Failure_NodeNotInCache
public function testSaveNode_Failure_NodeNotInCache()
{
$nodeId = 123;
$node = new Node($this->client);
$node->useLazyLoad(false)->setId($nodeId);
$this->transport->expects($this->once())->method('put')->with('/node/123/properties', array())->will($this->returnValue(array('code' => 400)));
try {
$this->client->saveNode($node);
$this->fail();
} catch (Exception $e) {
$this->assertFalse($this->cache->get("node-{$nodeId}"));
}
}
示例4: 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;
}