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


PHP Node::setProperties方法代码示例

本文整理汇总了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'));
 }
开发者ID:MobilityMaster,项目名称:neo4jphp,代码行数:13,代码来源:Client_Batch_NodeTest.php

示例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);
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:9,代码来源:ClientTest.php

示例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));
 }
开发者ID:BobLuo,项目名称:Neo4j,代码行数:15,代码来源:Client.php

示例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;
 }
开发者ID:hasantayyar,项目名称:Neo4J-PHP-client,代码行数:8,代码来源:neo4j.class.php

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

示例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;
 }
开发者ID:nightchiller,项目名称:pneo4j,代码行数:15,代码来源:Node.php


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