Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 058d248

Browse files
author
epriestley
committed
Expose the "file attached to object" and "object attached to file" edges via "edge.search"
Summary: See PHI1901. An install would like improved support for identifying files related to an object (like a task or revision) for retention/archival/backup/migration/snapshotting purposes. The "attachment" edge is not really user-level: it just means "if you can see the object, that allows you to see the file". This set includes files that users may not think of as "attached", like thumbnails and internal objects which are attached for technical reasons. However, this is generally an appropriate relationship to expose for retention purposes. Test Plan: Used "edge.search" to find files attached to a revision and objects attached to a file. Differential Revision: https://secure.phabricator.com/D21480
1 parent 1f7c736 commit 058d248

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/applications/files/edge/PhabricatorFileHasObjectEdgeType.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,16 @@ public function shouldWriteInverseTransactions() {
1212
return true;
1313
}
1414

15+
public function getConduitKey() {
16+
return 'file.attached-objects';
17+
}
18+
19+
public function getConduitName() {
20+
return pht('File Has Object');
21+
}
22+
23+
public function getConduitDescription() {
24+
return pht('The source file is attached to the destination object.');
25+
}
26+
1527
}

src/applications/transactions/edges/PhabricatorObjectHasFileEdgeType.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ public function shouldWriteInverseTransactions() {
1212
return true;
1313
}
1414

15+
public function getConduitKey() {
16+
return 'object.attached-files';
17+
}
18+
19+
public function getConduitName() {
20+
return pht('Object Has Files');
21+
}
22+
23+
public function getConduitDescription() {
24+
return pht('The source object is associated with the destination file.');
25+
}
26+
1527
public function getTransactionAddString(
1628
$actor,
1729
$add_count,

0 commit comments

Comments
 (0)