Differential D19911 Diff 47526 src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
Show All 35 Lines | public function generateObject() { | ||||
$files = id(new PhabricatorFileQuery()) | $files = id(new PhabricatorFileQuery()) | ||||
->setViewer($author) | ->setViewer($author) | ||||
->withPHIDs($file_phids) | ->withPHIDs($file_phids) | ||||
->execute(); | ->execute(); | ||||
$mock->setCoverPHID(head($files)->getPHID()); | $mock->setCoverPHID(head($files)->getPHID()); | ||||
$sequence = 0; | $sequence = 0; | ||||
$images = array(); | $images = array(); | ||||
foreach ($files as $file) { | foreach ($files as $file) { | ||||
$image = new PholioImage(); | $image = PholioImage::initializeNewImage() | ||||
$image->setFilePHID($file->getPHID()); | ->setFilePHID($file->getPHID()) | ||||
$image->setSequence($sequence++); | ->setSequence($sequence++) | ||||
$image->attachMock($mock); | ->attachMock($mock); | ||||
$images[] = $image; | $images[] = $image; | ||||
} | } | ||||
// Apply Transactions | // Apply Transactions | ||||
$transactions = array(); | $transactions = array(); | ||||
foreach ($changes as $type => $value) { | foreach ($changes as $type => $value) { | ||||
$transaction = clone $template; | $transaction = clone $template; | ||||
$transaction->setTransactionType($type); | $transaction->setTransactionType($type); | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |