2012-03-28 01:22:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @group conduit
|
|
|
|
*/
|
|
|
|
abstract class ConduitAPI_flag_Method extends ConduitAPIMethod {
|
|
|
|
|
2013-03-13 15:09:05 +01:00
|
|
|
public function getApplication() {
|
|
|
|
return PhabricatorApplication::getByClass(
|
2013-05-16 02:01:34 +02:00
|
|
|
'PhabricatorApplicationFlags');
|
2013-03-13 15:09:05 +01:00
|
|
|
}
|
|
|
|
|
2013-03-01 02:15:09 +01:00
|
|
|
protected function attachHandleToFlag($flag, PhabricatorUser $user) {
|
2012-08-03 20:41:33 +02:00
|
|
|
$flag->attachHandle(
|
2013-03-01 02:15:09 +01:00
|
|
|
PhabricatorObjectHandleData::loadOneHandle(
|
|
|
|
$flag->getObjectPHID(),
|
|
|
|
$user));
|
2012-08-03 20:41:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function buildFlagInfoDictionary($flag) {
|
|
|
|
$color = $flag->getColor();
|
|
|
|
$uri = PhabricatorEnv::getProductionURI($flag->getHandle()->getURI());
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'id' => $flag->getID(),
|
|
|
|
'ownerPHID' => $flag->getOwnerPHID(),
|
|
|
|
'type' => $flag->getType(),
|
|
|
|
'objectPHID' => $flag->getObjectPHID(),
|
|
|
|
'reasonPHID' => $flag->getReasonPHID(),
|
|
|
|
'color' => $color,
|
|
|
|
'colorName' => PhabricatorFlagColor::getColorName($color),
|
|
|
|
'note' => $flag->getNote(),
|
|
|
|
'handle' => array(
|
|
|
|
'uri' => $uri,
|
|
|
|
'name' => $flag->getHandle()->getName(),
|
|
|
|
'fullname' => $flag->getHandle()->getFullName(),
|
|
|
|
),
|
|
|
|
'dateCreated' => $flag->getDateCreated(),
|
|
|
|
'dateModified' => $flag->getDateModified(),
|
|
|
|
);
|
|
|
|
}
|
2012-03-28 01:22:40 +02:00
|
|
|
|
|
|
|
}
|