当前位置: 首页>>代码示例>>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;未经允许,请勿转载。