1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-28 14:39:36 +01:00
phorge-phorge/src/applications/pholio/engine/PholioMockTimelineEngine.php
epriestley b1e7e3a10e Reduce the amount of weird "static" and "cache" behavior in Pholio query classes
Summary: Depends on D19922. Ref T11351. These query classes have some slightly weird behavior, including `public static function loadImages(...)`. Convert all this stuff into more standard query patterns.

Test Plan: Grepped for callsites, browsed around in Pholio.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11351

Differential Revision: https://secure.phabricator.com/D19923
2018-12-20 15:32:13 -08:00

22 lines
461 B
PHP

<?php
final class PholioMockTimelineEngine
extends PhabricatorTimelineEngine {
protected function newTimelineView() {
$viewer = $this->getViewer();
$object = $this->getObject();
$images = id(new PholioImageQuery())
->setViewer($viewer)
->withMocks(array($object))
->needInlineComments(true)
->execute();
$object->attachImages($images);
return id(new PholioTransactionView())
->setMock($object);
}
}