当前位置: 首页>>代码示例>>PHP>>正文


PHP Relationship::useLazyLoad方法代码示例

本文整理汇总了PHP中Relationship::useLazyLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::useLazyLoad方法的具体用法?PHP Relationship::useLazyLoad怎么用?PHP Relationship::useLazyLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Relationship的用法示例。


在下文中一共展示了Relationship::useLazyLoad方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSaveRelationship_UpdateTransportError_ThrowsException

 public function testSaveRelationship_UpdateTransportError_ThrowsException()
 {
     $properties = array('foo' => 'bar', 'baz' => 'qux');
     $rel = new Relationship($this->client);
     $rel->useLazyLoad(false)->setId(123)->setProperties($properties);
     $this->transport->expects($this->once())->method('put')->with('/relationship/123/properties', $properties)->will($this->returnValue(array('code' => 400)));
     $this->setExpectedException('Everyman\\Neo4j\\Exception');
     $this->client->saveRelationship($rel);
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:9,代码来源:ClientTest.php

示例2: 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;
 }
开发者ID:pin-cnx,项目名称:orientdb-php,代码行数:16,代码来源:EntityMapper.php

示例3: testSaveRelationship_Failure_RelationshipNotInCache

 public function testSaveRelationship_Failure_RelationshipNotInCache()
 {
     $relId = 123;
     $rel = new Relationship($this->client);
     $rel->useLazyLoad(false)->setId($relId);
     $this->transport->expects($this->once())->method('put')->with('/relationship/123/properties', array())->will($this->returnValue(array('code' => 400)));
     try {
         $this->client->saveRelationship($rel);
         $this->fail();
     } catch (Exception $e) {
         $this->assertFalse($this->cache->get("relationship-{$relId}"));
     }
 }
开发者ID:MobilityMaster,项目名称:neo4jphp,代码行数:13,代码来源:Client_CacheTest.php

示例4: testCommitBatch_UpdateRelationship_Success_ReturnsTrue

 public function testCommitBatch_UpdateRelationship_Success_ReturnsTrue()
 {
     $rel = new Relationship($this->client);
     $rel->useLazyLoad(false)->setId(123)->setProperties(array('foo' => 'bar', 'baz' => 'qux'));
     $request = array(array('id' => 0, 'method' => 'PUT', 'to' => '/relationship/123/properties', 'body' => array('foo' => 'bar', 'baz' => 'qux')));
     $return = array('code' => 200, 'data' => array(array('id' => 0)));
     $this->batch->save($rel);
     $this->setupTransportExpectation($request, $this->returnValue($return));
     $result = $this->client->commitBatch($this->batch);
     $this->assertTrue($result);
     $this->assertSame($rel, $this->client->getEntityCache()->getCachedEntity(123, 'relationship'));
 }
开发者ID:pin-cnx,项目名称:orientdb-php,代码行数:12,代码来源:Client_Batch_RelationshipTest.php


注:本文中的Relationship::useLazyLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。