mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-20 13:52:40 +01:00
API for editing edge data
Summary: Add the ``PhabricatorEdgeDataEditor`` that allows you to edit the data attached to an edge and its inverse. Test Plan: Create several edges and update the data attached. Once duplicating the data on both the edge and its inverse, and once setting different value for both. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1279 Differential Revision: https://secure.phabricator.com/D5447
This commit is contained in:
parent
5320d85343
commit
6115756e9d
1 changed files with 4 additions and 3 deletions
|
@ -33,7 +33,8 @@ final class PhabricatorEdgeEditor extends PhabricatorEditor {
|
|||
/**
|
||||
* Add a new edge (possibly also adding its inverse). Changes take effect when
|
||||
* you call @{method:save}. If the edge already exists, it will not be
|
||||
* overwritten. Removals queued with @{method:removeEdge} are executed before
|
||||
* overwritten, but if data is attached to the edge it will be updated.
|
||||
* Removals queued with @{method:removeEdge} are executed before
|
||||
* adds, so the effect of removing and adding the same edge is to overwrite
|
||||
* any existing edge.
|
||||
*
|
||||
|
@ -280,8 +281,8 @@ final class PhabricatorEdgeEditor extends PhabricatorEditor {
|
|||
foreach (array_chunk($sql, 256) as $chunk) {
|
||||
queryfx(
|
||||
$conn_w,
|
||||
'INSERT IGNORE INTO %T (src, type, dst, dateCreated, seq, dataID)
|
||||
VALUES %Q',
|
||||
'INSERT INTO %T (src, type, dst, dateCreated, seq, dataID)
|
||||
VALUES %Q ON DUPLICATE KEY UPDATE dataID = VALUES(dataID)',
|
||||
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
|
||||
implode(', ', $chunk));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue