本文整理汇总了PHP中PhabricatorApplicationTransaction::getObjectPHID方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationTransaction::getObjectPHID方法的具体用法?PHP PhabricatorApplicationTransaction::getObjectPHID怎么用?PHP PhabricatorApplicationTransaction::getObjectPHID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationTransaction
的用法示例。
在下文中一共展示了PhabricatorApplicationTransaction::getObjectPHID方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction)
{
$object_phid = $xaction->getObjectPHID();
$author_phid = $xaction->getAuthorPHID();
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
return pht('%s updated the test plan for %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid));
}
示例2: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction, PhabricatorFeedStory $story)
{
$object_phid = $xaction->getObjectPHID();
$author_phid = $xaction->getAuthorPHID();
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
if (strlen($old)) {
return pht('%s retitled %s, from "%s" to "%s".', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid), $old, $new);
} else {
return pht('%s created %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid));
}
}
示例3: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction, PhabricatorFeedStory $story)
{
$object_phid = $xaction->getObjectPHID();
$author_phid = $xaction->getAuthorPHID();
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
if ($old) {
return pht('%s updated the repository for %s from %s to %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid), $xaction->renderHandleLink($old), $xaction->renderHandleLink($new));
} else {
return pht('%s set the repository for %s to %s.', $xaction->renderHandleLink($author_phid), $xaction->renderHandleLink($object_phid), $xaction->renderHandleLink($new));
}
}
示例4: guessCancelURI
protected function guessCancelURI(PhabricatorUser $viewer, PhabricatorApplicationTransaction $xaction)
{
// Take an educated guess at the URI where the transactions appear so we
// can send the cancel button somewhere sensible. This won't always get the
// best answer (for example, Diffusion's history is visible on a page other
// than the main object view page) but should always get a reasonable one.
$cancel_uri = '/';
$handle = id(new PhabricatorHandleQuery())->setViewer($viewer)->withPHIDs(array($xaction->getObjectPHID()))->executeOne();
if ($handle) {
$cancel_uri = $handle->getURI();
}
return $cancel_uri;
}
示例5: applyApplicationTransactionExternalEffects
public function applyApplicationTransactionExternalEffects(PhabricatorApplicationTransaction $xaction)
{
$object_phid = $xaction->getObjectPHID();
$old = $this->decodeValue($xaction->getOldValue());
$new = $this->decodeValue($xaction->getNewValue());
$old_phids = array_fuse($old);
$new_phids = array_fuse($new);
$rem_phids = array_diff_key($old_phids, $new_phids);
$add_phids = array_diff_key($new_phids, $old_phids);
$altered_phids = $rem_phids + $add_phids;
if (!$altered_phids) {
return;
}
$authorizations = id(new DrydockAuthorizationQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withObjectPHIDs(array($object_phid))->withBlueprintPHIDs($altered_phids)->execute();
$authorizations = mpull($authorizations, null, 'getBlueprintPHID');
$state_active = DrydockAuthorization::OBJECTAUTH_ACTIVE;
$state_inactive = DrydockAuthorization::OBJECTAUTH_INACTIVE;
$state_requested = DrydockAuthorization::BLUEPRINTAUTH_REQUESTED;
// Disable the object side of the authorization for any existing
// authorizations.
foreach ($rem_phids as $rem_phid) {
$authorization = idx($authorizations, $rem_phid);
if (!$authorization) {
continue;
}
$authorization->setObjectAuthorizationState($state_inactive)->save();
}
// For new authorizations, either add them or reactivate them depending
// on the current state.
foreach ($add_phids as $add_phid) {
$needs_update = false;
$authorization = idx($authorizations, $add_phid);
if (!$authorization) {
$authorization = id(new DrydockAuthorization())->setObjectPHID($object_phid)->setObjectAuthorizationState($state_active)->setBlueprintPHID($add_phid)->setBlueprintAuthorizationState($state_requested);
$needs_update = true;
} else {
$current_state = $authorization->getObjectAuthorizationState();
if ($current_state != $state_active) {
$authorization->setObjectAuthorizationState($state_active);
$needs_update = true;
}
}
if ($needs_update) {
$authorization->save();
}
}
}
开发者ID:angieatdropboxdotcom,项目名称:phabricator,代码行数:47,代码来源:PhabricatorStandardCustomFieldBlueprints.php
示例6: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction)
{
$author_phid = $xaction->getAuthorPHID();
$object_phid = $xaction->getObjectPHID();
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
if (!$old) {
return pht('%s set %s to %s on %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $new, $xaction->renderHandleLink($object_phid));
} else {
if (!$new) {
return pht('%s removed %s on %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $xaction->renderHandleLink($object_phid));
} else {
return pht('%s changed %s from %s to %s on %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $old, $new, $xaction->renderHandleLink($object_phid));
}
}
}
示例7: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction)
{
$author_phid = $xaction->getAuthorPHID();
$object_phid = $xaction->getObjectPHID();
$old = $this->decodeValue($xaction->getOldValue());
$new = $this->decodeValue($xaction->getNewValue());
$add = array_diff($new, $old);
$rem = array_diff($old, $new);
if ($add && !$rem) {
return pht('%s updated %s for %s, added %d: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $xaction->renderHandleLink($object_phid), phutil_count($add), $xaction->renderHandleList($add));
} else {
if ($rem && !$add) {
return pht('%s updated %s for %s, removed %s: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $xaction->renderHandleLink($object_phid), phutil_count($rem), $xaction->renderHandleList($rem));
} else {
return pht('%s updated %s for %s, added %s: %s; removed %s: %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $xaction->renderHandleLink($object_phid), phutil_count($add), $xaction->renderHandleList($add), phutil_count($rem), $xaction->renderHandleList($rem));
}
}
}
示例8: getApplicationTransactionTitleForFeed
public function getApplicationTransactionTitleForFeed(PhabricatorApplicationTransaction $xaction)
{
$author_phid = $xaction->getAuthorPHID();
$object_phid = $xaction->getObjectPHID();
return pht('%s edited %s on %s.', $xaction->renderHandleLink($author_phid), $this->getFieldName(), $xaction->renderHandleLink($object_phid));
}
示例9: applyApplicationTransactionExternalEffects
public function applyApplicationTransactionExternalEffects(PhabricatorApplicationTransaction $xaction)
{
$old = $this->decodeValue($xaction->getOldValue());
$new = $this->decodeValue($xaction->getNewValue());
DrydockAuthorization::applyAuthorizationChanges($this->getViewer(), $xaction->getObjectPHID(), $old, $new);
}