本文整理汇总了PHP中Relationship::setProperties方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::setProperties方法的具体用法?PHP Relationship::setProperties怎么用?PHP Relationship::setProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::setProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inflateFromResponse
public static function inflateFromResponse($db, $response)
{
$start_path = explode("/", $response['start']);
$end_path = explode("/", $response['end']);
$self_path = explode("/", $response['self']);
$start = $db->getNodeById(end($start_path));
$end = $db->getNodeById(end($end_path));
$relationship = new Relationship($db, $start, $end, $response['type']);
$relationship->_is_new = false;
$relationship->_id = end($self_path);
$relationship->setProperties($response['data']);
return $relationship;
}
示例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;
}
示例3: loadRelationship
/**
* Load the given relationship with data from the server
*
* @param Relationship $rel
* @return boolean
*/
public function loadRelationship(Relationship $rel)
{
$cached = $this->getEntityCache()->getCachedEntity($rel->getId(), 'relationship');
if ($cached) {
$rel->setProperties($cached->getProperties());
return true;
}
return $this->runCommand(new Command\GetRelationship($this, $rel));
}
示例4: inflateFromResponse
public static function inflateFromResponse(GraphDatabaseService $neo_db, array $response)
{
$start_id = end(explode("/", $response['start']));
$end_id = end(explode("/", $response['end']));
$start = $neo_db->getNodeById($start_id);
$end = $neo_db->getNodeById($end_id);
$relationship = new Relationship($neo_db, $start, $end, $response['type']);
$relationship->_is_new = FALSE;
$relationship->_id = end(explode("/", $response['self']));
$relationship->setProperties($response['data']);
return $relationship;
}