Path: blob/master/src/applications/flag/conduit/FlagConduitAPIMethod.php
12256 views
<?php12abstract class FlagConduitAPIMethod extends ConduitAPIMethod {34final public function getApplication() {5return PhabricatorApplication::getByClass('PhabricatorFlagsApplication');6}78protected function attachHandleToFlag($flag, PhabricatorUser $user) {9$handle = id(new PhabricatorHandleQuery())10->setViewer($user)11->withPHIDs(array($flag->getObjectPHID()))12->executeOne();13$flag->attachHandle($handle);14}1516protected function buildFlagInfoDictionary($flag) {17$color = $flag->getColor();18$uri = PhabricatorEnv::getProductionURI($flag->getHandle()->getURI());1920return array(21'id' => $flag->getID(),22'ownerPHID' => $flag->getOwnerPHID(),23'type' => $flag->getType(),24'objectPHID' => $flag->getObjectPHID(),25'reasonPHID' => $flag->getReasonPHID(),26'color' => $color,27'colorName' => PhabricatorFlagColor::getColorName($color),28'note' => $flag->getNote(),29'handle' => array(30'uri' => $uri,31'name' => $flag->getHandle()->getName(),32'fullname' => $flag->getHandle()->getFullName(),33),34'dateCreated' => $flag->getDateCreated(),35'dateModified' => $flag->getDateModified(),36);37}3839}404142