当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorPHID::generateNewPHID方法代码示例

本文整理汇总了PHP中PhabricatorPHID::generateNewPHID方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorPHID::generateNewPHID方法的具体用法?PHP PhabricatorPHID::generateNewPHID怎么用?PHP PhabricatorPHID::generateNewPHID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorPHID的用法示例。


在下文中一共展示了PhabricatorPHID::generateNewPHID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createBasicDummyHandle

 protected function createBasicDummyHandle($name, $type, $fullname = null, $uri = null)
 {
     $id = mt_rand(15, 9999);
     $handle = new PhabricatorObjectHandle();
     $handle->setName($name);
     $handle->setType($type);
     $handle->setPHID(PhabricatorPHID::generateNewPHID($type));
     if ($fullname) {
         $handle->setFullName($fullname);
     } else {
         $handle->setFullName(sprintf('%s%d: %s', substr($type, 0, 1), $id, $name));
     }
     if ($uri) {
         $handle->setURI($uri);
     }
     return $handle;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:17,代码来源:PhabricatorUIExample.php

示例2: save

 public function save()
 {
     $this->subscriptionClassKey = PhabricatorHash::digestForIndex($this->subscriptionClass);
     $this->subscriptionRefKey = PhabricatorHash::digestForIndex($this->subscriptionRef);
     $is_new = !$this->getID();
     $this->openTransaction();
     // If we're saving this subscription for the first time, we're also
     // going to set up the trigger for it.
     if ($is_new) {
         $trigger_phid = PhabricatorPHID::generateNewPHID(PhabricatorWorkerTriggerPHIDType::TYPECONST);
         $this->setTriggerPHID($trigger_phid);
     }
     $result = parent::save();
     if ($is_new) {
         $trigger_action = new PhabricatorScheduleTaskTriggerAction(array('class' => 'PhortuneSubscriptionWorker', 'data' => array('subscriptionPHID' => $this->getPHID()), 'options' => array('objectPHID' => $this->getPHID(), 'priority' => PhabricatorWorker::PRIORITY_BULK)));
         $trigger = $this->getTrigger();
         $trigger->setPHID($trigger_phid);
         $trigger->setAction($trigger_action);
         $trigger->save();
     }
     $this->saveTransaction();
     return $result;
 }
开发者ID:pugong,项目名称:phabricator,代码行数:23,代码来源:PhortuneSubscription.php

示例3: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID('HLXS');
 }
开发者ID:nguyennamtien,项目名称:phabricator,代码行数:4,代码来源:HeraldTranscript.php

示例4: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhortuneMerchantPHIDType::TYPECONST);
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:4,代码来源:PhortuneMerchant.php

示例5: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorPHIDConstants::PHID_TYPE_AUTH);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:4,代码来源:PhabricatorAuthProviderConfig.php

示例6: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(HarbormasterBuildPlanPHIDType::TYPECONST);
 }
开发者ID:Houzz,项目名称:phabricator,代码行数:4,代码来源:HarbormasterBuildPlan.php

示例7: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PonderQuestionPHIDType::TYPECONST);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:4,代码来源:PonderQuestion.php

示例8: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:4,代码来源:HeraldRule.php

示例9: foreach

 }
 // Build the main comment transaction.
 foreach ($main_comments as $main) {
     $xactions[] = array('type' => PhabricatorTransactions::TYPE_COMMENT, 'old' => null, 'new' => null, 'phid' => $main['transactionPHID'], 'comment' => $main);
 }
 // Build inline comment transactions.
 foreach ($inline_comments as $inline) {
     $xactions[] = array('type' => PhabricatorAuditActionConstants::INLINE, 'old' => null, 'new' => null, 'phid' => $inline['transactionPHID'], 'comment' => $inline);
 }
 foreach ($xactions as $xaction) {
     // Generate a new PHID, if we don't already have one from the comment
     // table. We pregenerated into the comment table to make this a little
     // easier, so we only need to write to one table.
     $xaction_phid = idx($xaction, 'phid');
     if (!$xaction_phid) {
         $xaction_phid = PhabricatorPHID::generateNewPHID(PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, PhabricatorRepositoryCommitPHIDType::TYPECONST);
     }
     unset($xaction['phid']);
     $comment_phid = null;
     $comment_version = 0;
     if (idx($xaction, 'comment')) {
         $comment_phid = $xaction['comment']['phid'];
         $comment_version = 1;
     }
     $old = idx($xaction, 'old');
     $new = idx($xaction, 'new');
     $meta = idx($xaction, 'meta', array());
     queryfx($conn_w, 'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy,
       commentPHID, commentVersion, transactionType, oldValue, newValue,
       contentSource, metadata, dateCreated, dateModified)
     VALUES (%s, %s, %s, %s, %s, %ns, %d, %s, %ns, %ns, %s, %s, %d, %d)', 'audit_transaction', $xaction_phid, $row['actorPHID'], $row['targetPHID'], 'public', $row['actorPHID'], $comment_phid, $comment_version, $xaction['type'], json_encode($old), json_encode($new), $content_source, json_encode($meta), $row['dateCreated'], $row['dateModified']);
开发者ID:denghp,项目名称:phabricator,代码行数:31,代码来源:20140725.audit.1.migxactions.php

示例10: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorOAuthServerClientPHIDType::TYPECONST);
 }
开发者ID:rchicoli,项目名称:phabricator,代码行数:4,代码来源:PhabricatorOAuthServerClient.php

示例11: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorPeopleExternalPHIDType::TYPECONST);
 }
开发者ID:pugong,项目名称:phabricator,代码行数:4,代码来源:PhabricatorExternalAccount.php

示例12: PhabricatorAuditTransaction

<?php

$audit_table = new PhabricatorAuditTransaction();
$conn_w = $audit_table->establishConnection('w');
$conn_w->openTransaction();
$src_table = 'audit_inlinecomment';
$dst_table = 'audit_transaction_comment';
echo pht('Migrating Audit inline comments to new format...') . "\n";
$content_source = PhabricatorContentSource::newForSource(PhabricatorContentSource::SOURCE_LEGACY, array())->serialize();
$rows = new LiskRawMigrationIterator($conn_w, $src_table);
foreach ($rows as $row) {
    $id = $row['id'];
    echo pht('Migrating inline #%d...', $id);
    if ($row['auditCommentID']) {
        $xaction_phid = PhabricatorPHID::generateNewPHID(PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, PhabricatorRepositoryCommitPHIDType::TYPECONST);
    } else {
        $xaction_phid = null;
    }
    $comment_phid = PhabricatorPHID::generateNewPHID(PhabricatorPHIDConstants::PHID_TYPE_XCMT, PhabricatorRepositoryCommitPHIDType::TYPECONST);
    queryfx($conn_w, 'INSERT IGNORE INTO %T
      (id, phid, transactionPHID, authorPHID, viewPolicy, editPolicy,
        commentVersion, content, contentSource, isDeleted,
        dateCreated, dateModified, commitPHID, pathID,
        isNewFile, lineNumber, lineLength, hasReplies, legacyCommentID)
      VALUES (%d, %s, %ns, %s, %s, %s,
        %d, %s, %s, %d,
        %d, %d, %s, %nd,
        %d, %d, %d, %d, %nd)', $dst_table, $row['id'], $comment_phid, $xaction_phid, $row['authorPHID'], 'public', $row['authorPHID'], 1, $row['content'], $content_source, 0, $row['dateCreated'], $row['dateModified'], $row['commitPHID'], $row['pathID'], $row['isNewFile'], $row['lineNumber'], $row['lineLength'], 0, $row['auditCommentID']);
}
$conn_w->saveTransaction();
echo pht('Done.') . "\n";
开发者ID:truSense,项目名称:phabricator,代码行数:31,代码来源:20140722.audit.3.miginlines.php

示例13: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(DifferentialRevisionPHIDType::TYPECONST);
 }
开发者ID:truSense,项目名称:phabricator,代码行数:4,代码来源:DifferentialRevision.php

示例14: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(PhabricatorEditEngineConfigurationPHIDType::TYPECONST);
 }
开发者ID:hamilyjing,项目名称:phabricator,代码行数:4,代码来源:PhabricatorEditEngineConfiguration.php

示例15: generatePHID

 public function generatePHID()
 {
     return PhabricatorPHID::generateNewPHID(DivinerBookPHIDType::TYPECONST);
 }
开发者ID:denghp,项目名称:phabricator,代码行数:4,代码来源:DivinerLiveBook.php


注:本文中的PhabricatorPHID::generateNewPHID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。