當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PhabricatorLiskDAO::getPHID方法代碼示例

本文整理匯總了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);
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:29,代碼來源:AlmanacDeviceEditor.php

示例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;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:10,代碼來源:PhabricatorFactCountEngine.php

示例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);
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:19,代碼來源:AlmanacServiceEditor.php

示例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);
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:22,代碼來源:AlmanacEditor.php

示例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;
     }
 }
開發者ID:rchicoli,項目名稱:phabricator,代碼行數:8,代碼來源:PhabricatorRepositoryEditor.php

示例6: getMailThreadID

 protected function getMailThreadID(PhabricatorLiskDAO $object)
 {
     return 'maniphest-task-' . $object->getPHID();
 }
開發者ID:miaokuan,項目名稱:phabricator,代碼行數:4,代碼來源:ManiphestTransactionEditor.php

示例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;
 }
開發者ID:kristain,項目名稱:phabricator,代碼行數:12,代碼來源:DifferentialTransactionEditor.php

示例8: buildMailTemplate

 protected function buildMailTemplate(PhabricatorLiskDAO $object)
 {
     $phid = $object->getPHID();
     $name = $object->getName();
     return id(new PhabricatorMetaMTAMail())->setSubject($name)->addHeader('Thread-Topic', $phid);
 }
開發者ID:MenZil-Team,項目名稱:phabricator,代碼行數:6,代碼來源:PhameBlogEditor.php

示例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}");
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:7,代碼來源:ReleephRequestTransactionalEditor.php

示例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();
 }
開發者ID:patelhardik,項目名稱:phabricator,代碼行數:9,代碼來源:PhabricatorProjectTransactionEditor.php

示例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;
 }
開發者ID:pugong,項目名稱:phabricator,代碼行數:14,代碼來源:PhortuneCartEditor.php

示例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);
 }
開發者ID:fengshao0907,項目名稱:phabricator,代碼行數:34,代碼來源:PhabricatorCalendarEventEditor.php

示例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());
 }
開發者ID:endlessm,項目名稱:phabricator,代碼行數:6,代碼來源:PhrictionTransactionEditor.php

示例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;
 }
開發者ID:hrb518,項目名稱:phabricator,代碼行數:23,代碼來源:PhabricatorAuditEditor.php

示例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}");
 }
開發者ID:hrb518,項目名稱:phabricator,代碼行數:7,代碼來源:LegalpadDocumentEditor.php


注:本文中的PhabricatorLiskDAO::getPHID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。