Changeset View
Changeset View
Standalone View
Standalone View
src/applications/pholio/xaction/PholioImageFileTransaction.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | final class PholioImageFileTransaction | ||||
public function extractFilePHIDs($object, $value) { | public function extractFilePHIDs($object, $value) { | ||||
$editor = $this->getEditor(); | $editor = $this->getEditor(); | ||||
// NOTE: This method is a little weird (and includes ALL the file PHIDs, | // NOTE: This method is a little weird (and includes ALL the file PHIDs, | ||||
// including old file PHIDs) because we currently don't have a storage | // including old file PHIDs) because we currently don't have a storage | ||||
// object when called. This might change at some point. | // object when called. This might change at some point. | ||||
$new_phids = $value; | $image_changes = $value; | ||||
$image_phids = array(); | |||||
foreach ($image_changes as $change_type => $phids) { | |||||
foreach ($phids as $phid) { | |||||
$image_phids[$phid] = $phid; | |||||
} | |||||
} | |||||
$file_phids = array(); | $file_phids = array(); | ||||
foreach ($new_phids as $phid) { | foreach ($image_phids as $image_phid) { | ||||
$file_phids[] = $editor->loadPholioImage($object, $phid) | $file_phids[] = $editor->loadPholioImage($object, $image_phid) | ||||
->getFilePHID(); | ->getFilePHID(); | ||||
} | } | ||||
return $file_phids; | return $file_phids; | ||||
} | } | ||||
public function mergeTransactions( | public function mergeTransactions( | ||||
$object, | $object, | ||||
PhabricatorApplicationTransaction $u, | PhabricatorApplicationTransaction $u, | ||||
PhabricatorApplicationTransaction $v) { | PhabricatorApplicationTransaction $v) { | ||||
return $this->getEditor()->mergePHIDOrEdgeTransactions($u, $v); | return $this->getEditor()->mergePHIDOrEdgeTransactions($u, $v); | ||||
} | } | ||||
} | } |