本文整理汇总了PHP中PhabricatorLiskDAO::getPHID方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorLiskDAO::getPHID方法的具体用法?PHP PhabricatorLiskDAO::getPHID怎么用?PHP PhabricatorLiskDAO::getPHID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorLiskDAO
的用法示例。
在下文中一共展示了PhabricatorLiskDAO::getPHID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applyCustomExternalTransaction
protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case AlmanacDeviceTransaction::TYPE_NAME:
return;
case AlmanacDeviceTransaction::TYPE_INTERFACE:
$old = $xaction->getOldValue();
if ($old) {
$interface = id(new AlmanacInterfaceQuery())->setViewer($this->requireActor())->withIDs(array($old['id']))->executeOne();
if (!$interface) {
throw new Exception(pht('Unable to load interface!'));
}
} else {
$interface = AlmanacInterface::initializeNewInterface()->setDevicePHID($object->getPHID());
}
$new = $xaction->getNewValue();
if ($new) {
$interface->setNetworkPHID($new['networkPHID'])->setAddress($new['address'])->setPort((int) $new['port']);
if (idx($new, 'phid')) {
$interface->setPHID($new['phid']);
}
$interface->save();
} else {
$interface->delete();
}
return;
}
return parent::applyCustomExternalTransaction($object, $xaction);
}
示例2: computeRawFactsForObject
public function computeRawFactsForObject(PhabricatorLiskDAO $object)
{
$facts = array();
$phid = $object->getPHID();
$type = phid_get_type($phid);
foreach (array('N:*', 'N:' . $type) as $fact_type) {
$facts[] = id(new PhabricatorFactRaw())->setFactType($fact_type)->setObjectPHID($phid)->setValueX(1)->setEpoch($object->getDateCreated());
}
return $facts;
}
示例3: applyCustomExternalTransaction
protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case AlmanacServiceTransaction::TYPE_NAME:
return;
case AlmanacServiceTransaction::TYPE_LOCK:
$service = id(new AlmanacServiceQuery())->setViewer(PhabricatorUser::getOmnipotentUser())->withPHIDs(array($object->getPHID()))->needBindings(true)->executeOne();
$devices = array();
foreach ($service->getBindings() as $binding) {
$device = $binding->getInterface()->getDevice();
$devices[$device->getPHID()] = $device;
}
foreach ($devices as $device) {
$device->rebuildDeviceLocks();
}
return;
}
return parent::applyCustomExternalTransaction($object, $xaction);
}
示例4: applyCustomExternalTransaction
protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case AlmanacTransaction::TYPE_PROPERTY_UPDATE:
$property_key = $xaction->getMetadataValue('almanac.property');
if ($object->hasAlmanacProperty($property_key)) {
$property = $object->getAlmanacProperty($property_key);
} else {
$property = id(new AlmanacProperty())->setObjectPHID($object->getPHID())->setFieldName($property_key);
}
$property->setFieldValue($xaction->getNewValue())->save();
return;
case AlmanacTransaction::TYPE_PROPERTY_REMOVE:
$property_key = $xaction->getMetadataValue('almanac.property');
if ($object->hasAlmanacProperty($property_key)) {
$property = $object->getAlmanacProperty($property_key);
$property->delete();
}
return;
}
return parent::applyCustomExternalTransaction($object, $xaction);
}
示例5: applyCustomExternalTransaction
protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case PhabricatorRepositoryTransaction::TYPE_AUTOMATION_BLUEPRINTS:
DrydockAuthorization::applyAuthorizationChanges($this->getActor(), $object->getPHID(), $xaction->getOldValue(), $xaction->getNewValue());
break;
}
}
示例6: getMailThreadID
protected function getMailThreadID(PhabricatorLiskDAO $object)
{
return 'maniphest-task-' . $object->getPHID();
}
示例7: buildHeraldAdapter
protected function buildHeraldAdapter(PhabricatorLiskDAO $object, array $xactions)
{
$revision = id(new DifferentialRevisionQuery())->setViewer($this->getActor())->withPHIDs(array($object->getPHID()))->needActiveDiffs(true)->needReviewerStatus(true)->executeOne();
if (!$revision) {
throw new Exception(pht('Failed to load revision for Herald adapter construction!'));
}
$adapter = HeraldDifferentialRevisionAdapter::newLegacyAdapter($revision, $revision->getActiveDiff());
$reviewers = $revision->getReviewerStatus();
$reviewer_phids = mpull($reviewers, 'getReviewerPHID');
$adapter->setExplicitReviewers($reviewer_phids);
return $adapter;
}
示例8: buildMailTemplate
protected function buildMailTemplate(PhabricatorLiskDAO $object)
{
$phid = $object->getPHID();
$name = $object->getName();
return id(new PhabricatorMetaMTAMail())->setSubject($name)->addHeader('Thread-Topic', $phid);
}
示例9: buildMailTemplate
protected function buildMailTemplate(PhabricatorLiskDAO $object)
{
$id = $object->getID();
$phid = $object->getPHID();
$title = $object->getSummaryForDisplay();
return id(new PhabricatorMetaMTAMail())->setSubject("RQ{$id}: {$title}")->addHeader('Thread-Topic', "RQ{$id}: {$phid}");
}
示例10: addSlug
private function addSlug(PhabricatorLiskDAO $object, $name)
{
$slug = PhabricatorSlug::normalizeProjectSlug($name);
$slug_object = id(new PhabricatorProjectSlug())->loadOneWhere('slug = %s', $slug);
if ($slug_object) {
return;
}
$new_slug = id(new PhabricatorProjectSlug())->setSlug($slug)->setProjectPHID($object->getPHID())->save();
}
示例11: getMailTo
protected function getMailTo(PhabricatorLiskDAO $object)
{
$phids = array();
// Reload the cart to pull merchant and account information, in case we
// just created the object.
$cart = id(new PhortuneCartQuery())->setViewer($this->requireActor())->withPHIDs(array($object->getPHID()))->executeOne();
foreach ($cart->getAccount()->getMemberPHIDs() as $account_member) {
$phids[] = $account_member;
}
foreach ($cart->getMerchant()->getMemberPHIDs() as $merchant_member) {
$phids[] = $merchant_member;
}
return $phids;
}
示例12: applyCustomExternalTransaction
protected function applyCustomExternalTransaction(PhabricatorLiskDAO $object, PhabricatorApplicationTransaction $xaction)
{
switch ($xaction->getTransactionType()) {
case PhabricatorCalendarEventTransaction::TYPE_RECURRING:
case PhabricatorCalendarEventTransaction::TYPE_FREQUENCY:
case PhabricatorCalendarEventTransaction::TYPE_RECURRENCE_END_DATE:
case PhabricatorCalendarEventTransaction::TYPE_INSTANCE_OF_EVENT:
case PhabricatorCalendarEventTransaction::TYPE_SEQUENCE_INDEX:
case PhabricatorCalendarEventTransaction::TYPE_NAME:
case PhabricatorCalendarEventTransaction::TYPE_START_DATE:
case PhabricatorCalendarEventTransaction::TYPE_END_DATE:
case PhabricatorCalendarEventTransaction::TYPE_DESCRIPTION:
case PhabricatorCalendarEventTransaction::TYPE_CANCEL:
case PhabricatorCalendarEventTransaction::TYPE_ALL_DAY:
case PhabricatorCalendarEventTransaction::TYPE_ICON:
return;
case PhabricatorCalendarEventTransaction::TYPE_INVITE:
$map = $xaction->getNewValue();
$phids = array_keys($map);
$invitees = $object->getInvitees();
$invitees = mpull($invitees, null, 'getInviteePHID');
foreach ($phids as $phid) {
$invitee = idx($invitees, $phid);
if (!$invitee) {
$invitee = id(new PhabricatorCalendarEventInvitee())->setEventPHID($object->getPHID())->setInviteePHID($phid)->setInviterPHID($this->getActingAsPHID());
$invitees[] = $invitee;
}
$invitee->setStatus($map[$phid])->save();
}
$object->attachInvitees($invitees);
return;
}
return parent::applyCustomExternalTransaction($object, $xaction);
}
示例13: buildMailTemplate
protected function buildMailTemplate(PhabricatorLiskDAO $object)
{
$id = $object->getID();
$title = $object->getContent()->getTitle();
return id(new PhabricatorMetaMTAMail())->setSubject($title)->addHeader('Thread-Topic', $object->getPHID());
}
示例14: didApplyHeraldRules
protected function didApplyHeraldRules(PhabricatorLiskDAO $object, HeraldAdapter $adapter, HeraldTranscript $transcript)
{
$xactions = array();
$audit_phids = $adapter->getAuditMap();
foreach ($audit_phids as $phid => $rule_ids) {
foreach ($rule_ids as $rule_id) {
$this->addAuditReason($phid, pht('%s Triggered Audit', "H{$rule_id}"));
}
}
if ($audit_phids) {
$xactions[] = id(new PhabricatorAuditTransaction())->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS)->setNewValue(array_fuse(array_keys($audit_phids)))->setMetadataValue('auditStatus', PhabricatorAuditStatusConstants::AUDIT_REQUIRED)->setMetadataValue('auditReasonMap', $this->auditReasonMap);
}
HarbormasterBuildable::applyBuildPlans($object->getPHID(), $object->getRepository()->getPHID(), $adapter->getBuildPlans());
$limit = self::MAX_FILES_SHOWN_IN_EMAIL;
$files = $adapter->loadAffectedPaths();
sort($files);
if (count($files) > $limit) {
array_splice($files, $limit);
$files[] = pht('(This commit affected more than %d files. Only %d are shown here ' . 'and additional ones are truncated.)', $limit, $limit);
}
$this->affectedFiles = implode("\n", $files);
return $xactions;
}
示例15: buildMailTemplate
protected function buildMailTemplate(PhabricatorLiskDAO $object)
{
$id = $object->getID();
$phid = $object->getPHID();
$title = $object->getDocumentBody()->getTitle();
return id(new PhabricatorMetaMTAMail())->setSubject("L{$id}: {$title}")->addHeader('Thread-Topic', "L{$id}: {$phid}");
}