本文整理汇总了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;
}
示例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;
}
示例3: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID('HLXS');
}
示例4: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PhortuneMerchantPHIDType::TYPECONST);
}
示例5: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PhabricatorPHIDConstants::PHID_TYPE_AUTH);
}
示例6: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(HarbormasterBuildPlanPHIDType::TYPECONST);
}
示例7: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PonderQuestionPHIDType::TYPECONST);
}
示例8: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(HeraldRulePHIDType::TYPECONST);
}
示例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']);
示例10: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PhabricatorOAuthServerClientPHIDType::TYPECONST);
}
示例11: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PhabricatorPeopleExternalPHIDType::TYPECONST);
}
示例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";
示例13: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(DifferentialRevisionPHIDType::TYPECONST);
}
示例14: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(PhabricatorEditEngineConfigurationPHIDType::TYPECONST);
}
示例15: generatePHID
public function generatePHID()
{
return PhabricatorPHID::generateNewPHID(DivinerBookPHIDType::TYPECONST);
}